Skip to content

Commit 86129bc

Browse files
web3-botStebalien
authored andcommitted
add .github/workflows/go-test.yml
1 parent d8c36c8 commit 86129bc

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/go-test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# File managed by web3-bot. DO NOT EDIT.
2+
# See https://github.com/protocol/.github/ for details.
3+
4+
on: [push, pull_request]
5+
name: Go Test
6+
7+
jobs:
8+
unit:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ "ubuntu", "windows", "macos" ]
13+
go: [ "1.15.x", "1.16.x" ]
14+
runs-on: ${{ matrix.os }}-latest
15+
name: ${{ matrix.os}} (go ${{ matrix.go }})
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
submodules: recursive
20+
- uses: actions/setup-go@v2
21+
with:
22+
go-version: ${{ matrix.go }}
23+
- name: Go information
24+
run: |
25+
go version
26+
go env
27+
- name: Run tests
28+
uses: protocol/[email protected]
29+
with:
30+
run: go test -v -coverprofile coverage.txt ./...
31+
- name: Run tests (32 bit)
32+
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
33+
uses: protocol/[email protected]
34+
env:
35+
GOARCH: 386
36+
with:
37+
run: go test -v ./...
38+
- name: Run tests with race detector
39+
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
40+
uses: protocol/[email protected]
41+
with:
42+
run: go test -v -race ./...
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # v1.5.0
45+
with:
46+
file: coverage.txt
47+
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}

0 commit comments

Comments
 (0)