-
Notifications
You must be signed in to change notification settings - Fork 68
87 lines (72 loc) · 2.5 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: PR Checks
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: ubuntu-latest
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- 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@v3
with:
skip-cache: true
test:
name: Unit and Integration Tests
if: success()
runs-on: ubuntu-latest
needs:
- build
env:
HEDERA_NETWORK: localhost
OPERATOR_ID: ${{ secrets.LOCAL_OPERATOR_ID }}
OPERATOR_KEY: ${{ secrets.LOCAL_OPERATOR_KEY }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- 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: Tests Testnets
if: success()
env:
HEDERA_NETWORK: testnet
OPERATOR_ID: ${{ secrets.TESTNET_OPERATOR_ID }}
OPERATOR_KEY: ${{ secrets.TESTNET_OPERATOR_KEY }}
run: go test -tags="testnets" -timeout 9999s -v -coverprofile=testnets.out -covermode=atomic -race
- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit.out,./e2e.out,./testnets.out
- name: Stop the local node
run: npx @hashgraph/hedera-local stop