Repository navigation
46 lines (45 loc) · 1.5 KB
/
Copy pathtests.yml
File metadata and controls
46 lines (45 loc) · 1.5 KB
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
40
41
42
43
44
45
46
on: [push, pull_request]
name: Tests
jobs:
test:
strategy:
matrix:
# go.mod requires go >= 1.26.0, and setup-go (v6+) defaults to
# GOTOOLCHAIN=local, so older toolchains genuinely cannot build this
# module. Under setup-go@v5 the 1.21/1.22 cells silently downloaded
# the go.mod version and tested that instead -- they never exercised 1.21/1.22.
go-version: ['1.26.x', 'stable']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install Go
uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go-version }}
- name: Check formatting
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.26.x'
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "These files need gofmt:"
echo "$unformatted"
exit 1
fi
- name: Test
run: go test -v ./...
vulncheck:
# Dependabot alerts are disabled on this repo, so this is what surfaces
# known vulnerabilities in dependencies and the standard library.
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install Go
uses: actions/setup-go@v7
with:
# govulncheck@latest tracks the newest Go release
go-version: 'stable'
- name: Run govulncheck
run: go run golang.org/x/vuln/cmd/govulncheck@latest ./...