-
Notifications
You must be signed in to change notification settings - Fork 213
69 lines (69 loc) · 2.04 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Test
on:
push:
branches:
- master
- release/**
pull_request:
permissions:
contents: read
defaults:
run:
shell: bash
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Module Mode
runs-on: ${{ matrix.os }}-latest
env:
GO111MODULE: "on"
GOFLAGS: "-mod=readonly"
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go }}-
- name: Build
run: make build
- name: Vet
run: make vet
- name: Check go.mod Tidiness
run: make mod-tidy
if: ${{ matrix.go == '1.20' }}
- name: Test
run: make test-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # pin@v4.5.0
with:
directory: .coverage
token: ${{ secrets.CODECOV_TOKEN }}
- name: Test (with race detection)
run: make test-race
# The race detector adds considerable runtime overhead. To save time on
# pull requests, only run this step for a single job in the matrix. For
# all other workflow triggers (e.g., pushes to a release branch) run
# this step for the whole matrix.
if: ${{ github.event_name != 'pull_request' || (matrix.go == '1.23' && matrix.os == 'ubuntu') }}
timeout-minutes: 15
strategy:
matrix:
go: ["1.23", "1.22", "1.21", "1.20", "1.19", "1.18"]
os: [ubuntu, windows, macos]
fail-fast: false