Skip to content

chore: test ci

chore: test ci #1640

Workflow file for this run

name: PR Checks
defaults:
run:
shell: bash
permissions:
contents: read
on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: [ self-hosted, Linux, medium, ephemeral ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go 1.20
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.20"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
ref: 'refs/tags/v2.44.0'
- name: Vet Examples
run: go vet ./examples/...
- name: Vet
run: go vet .
- name: Build
run: go build -v .
- name: Lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
skip-cache: true
args: --timeout=5m
test:
name: Unit and Integration Tests
if: success()
runs-on: [ self-hosted, Linux, medium, ephemeral ]
needs:
- build
env:
OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"
OPERATOR_ID: "0.0.2"
HEDERA_NETWORK: "localhost"
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 18
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go 1.20
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.20"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
ref: 'refs/tags/v2.44.0'
- name: Start the local node
if: success()
run: npx @hashgraph/hedera-local start -d --network local
- name: Tests Unit
if: success()
run: go test -tags="unit" -timeout 9999s -v -coverprofile=unit.out -covermode=atomic -race
- name: Tests Integration
if: success()
run: go test -tags="e2e" -timeout 9999s -v -coverprofile=e2e.out -covermode=atomic -race
- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit.out,./e2e.out,./testnets.out
- name: Stop the local node
run: npx @hashgraph/hedera-local stop
run-examples:
name: Run Examples
if: success()
runs-on: [ self-hosted, Linux, medium, ephemeral ]
needs:
- build
env:
OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"
OPERATOR_ID: "0.0.2"
HEDERA_NETWORK: "localhost"
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 18
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go 1.20
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.20"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
ref: 'refs/tags/v2.44.0'
- name: Install Task
run: go install github.com/go-task/task/v3/cmd/task@v3.17.0
- name: Start the local node
if: success()
run: npx @hashgraph/hedera-local start -d --network local
- name: Run Examples
if: success()
run: task run-examples
- name: Stop the local node
run: npx @hashgraph/hedera-local stop