Skip to content

Commit 20e9aa6

Browse files
committed
.github/workflows: improve test.yml
1 parent 242a202 commit 20e9aa6

1 file changed

Lines changed: 46 additions & 13 deletions

File tree

.github/workflows/test.yml

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,58 @@
11
name: Go tests
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
pull_request:
5+
schedule: # daily at 09:42 UTC
6+
- cron: '42 9 * * *'
7+
workflow_dispatch:
38
permissions:
49
contents: read
510
jobs:
611
test:
712
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
go:
17+
- { go-version: stable }
18+
- { go-version: oldstable }
19+
- { go-version-file: go.mod }
20+
deps:
21+
- locked
22+
- latest
823
steps:
9-
- name: Install hurl
24+
- name: Install hurl 4.1.0
1025
run: |
1126
curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/4.1.0/hurl_4.1.0_amd64.deb
1227
sudo apt-get update && sudo apt-get install ./hurl_4.1.0_amd64.deb
13-
- name: Checkout repository
14-
uses: actions/checkout@v2
28+
- uses: actions/checkout@v5
1529
with:
16-
fetch-depth: 0
17-
- name: Install Go (from go.mod)
18-
uses: actions/setup-go@v4
30+
persist-credentials: false
31+
- uses: actions/setup-go@v6
1932
with:
20-
go-version-file: go.mod
21-
check-latest: true
22-
- name: Run tests
23-
run: go test ./...
24-
- name: Run tests (short + race)
25-
run: go test -short -race ./...
33+
go-version: ${{ matrix.go.go-version }}
34+
go-version-file: ${{ matrix.go.go-version-file }}
35+
- run: go get -u
36+
if: matrix.deps == 'latest'
37+
- run: go test ./...
38+
- run: go test -short -race ./...
39+
staticcheck:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v5
43+
with:
44+
persist-credentials: false
45+
- uses: actions/setup-go@v6
46+
with:
47+
go-version: stable
48+
- run: go run honnef.co/go/tools/cmd/staticcheck@latest ./...
49+
govulncheck:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v5
53+
with:
54+
persist-credentials: false
55+
- uses: actions/setup-go@v6
56+
with:
57+
go-version: stable
58+
- run: go run golang.org/x/vuln/cmd/govulncheck@latest ./...

0 commit comments

Comments
 (0)