Skip to content

Commit 1b41b14

Browse files
committed
add tests for windows, mac and ubuntu
1 parent 44fc508 commit 1b41b14

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/test.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Go Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v4
22+
with:
23+
go-version-file: "go.mod"
24+
cache: true
25+
26+
- name: Set up gotestfmt
27+
run: go install github.com/gotesttools/gotestfmt/v2/cmd/[email protected]
28+
29+
- name: Download Go modules
30+
run: go mod download
31+
32+
- name: Static Check
33+
uses: dominikh/staticcheck-action@v1
34+
with:
35+
checks: '["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-SA1019"]'
36+
version: "latest"
37+
install-go: false
38+
39+
- name: Test
40+
shell: bash
41+
run: |
42+
set -euo pipefail
43+
go test -race -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
44+
45+
- name: Upload test log
46+
uses: actions/upload-artifact@v4
47+
if: always()
48+
with:
49+
name: test-log-${{ matrix.os }}
50+
path: /tmp/gotest.log
51+
if-no-files-found: error

0 commit comments

Comments
 (0)