forked from gregjones/httpcache
-
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.1 KB
/
test.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
on:
push:
branches: [master]
pull_request:
name: Test
permissions:
contents: read
jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.22.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: ${{ matrix.go-version }}
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
shell: bash
- name: Update PATH
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Fmt
if: matrix.platform != 'windows-latest'
run: "diff <(gofmt -d .) <(printf '')"
shell: bash
- name: Vet
run: go vet ./...
- name: Staticcheck
# Ubuntu latest go.
if: strategy.job-index == 3
run: staticcheck ./...
- name: Test
run: go test -race ./... -coverpkg=./...