Skip to content

Commit 268227c

Browse files
committed
github: Replace the test workflow with the one used in Afero
Which is updated.
1 parent e9ba3ce commit 268227c

2 files changed

Lines changed: 39 additions & 34 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
name: Test
6+
permissions:
7+
contents: read
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
go-version: [1.19.x, 1.20.x, 1.21.x]
13+
platform: [ubuntu-latest, macos-latest, windows-latest]
14+
runs-on: ${{ matrix.platform }}
15+
steps:
16+
- name: Install Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: ${{ matrix.go-version }}
20+
- name: Install staticcheck
21+
if: matrix.go-version == '1.21.x'
22+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
23+
shell: bash
24+
- name: Update PATH
25+
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
26+
shell: bash
27+
- name: Checkout code
28+
uses: actions/checkout@v3
29+
- name: Fmt
30+
if: matrix.platform != 'windows-latest' # :(
31+
run: "diff <(gofmt -d .) <(printf '')"
32+
shell: bash
33+
- name: Vet
34+
run: go vet ./...
35+
- name: Staticcheck
36+
if: matrix.go-version == '1.21.x'
37+
run: staticcheck ./...
38+
- name: Test
39+
run: go test -race ./...

0 commit comments

Comments
 (0)