-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (47 loc) · 1.44 KB
/
go.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
name: Go
on:
pull_request
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Checkout
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Start Substrate node
run: docker run --rm -d --name substrate -p 9944:9944 ghcr.io/perun-network/polkadot-test-node:0.2.0
- name: Wait for Substrate node
# Wait for port 9944 to listen.
# https://github.com/marketplace/actions/wait-on did not work…
run: timeout 25 bash -c "until nc -z 127.0.0.1 9944; do sleep 1; done"
- name: Unit tests
# Running the go tests with the `-p 1` flag is important, since the
# tests otherwise are started in parallel and mess up the account nonce.
run: go test -timeout 360s -p 1 ./...
- name: Stop Substrate node
run: docker stop substrate