|
1 | 1 | 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: |
3 | 8 | permissions: |
4 | 9 | contents: read |
5 | 10 | jobs: |
6 | 11 | test: |
7 | 12 | 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 |
8 | 23 | steps: |
9 | | - - name: Install hurl |
| 24 | + - name: Install hurl 4.1.0 |
10 | 25 | run: | |
11 | 26 | curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/4.1.0/hurl_4.1.0_amd64.deb |
12 | 27 | 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 |
15 | 29 | 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 |
19 | 32 | 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