Update for new Perun-Polkadot-Node (Polkadot v1.9) #78
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.4.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 |