-
Notifications
You must be signed in to change notification settings - Fork 125
53 lines (42 loc) · 1.14 KB
/
ci.yaml
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
name: ci
on:
push:
branches: [main] # pushes TO main
pull_request:
branches: [main] # pull requests AGAINST main
# cancel CI runs when a new commit is pushed to any branch except main
concurrency:
group: "test-${{ github.ref }}"
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# build against the two latest releases, to match golang's release
# policy: https://go.dev/doc/devel/release#policy
go-version:
- 'stable'
- 'oldstable'
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{matrix.go-version}}
- uses: actions/checkout@v4
- name: test
run: make testci
- uses: codecov/codecov-action@v4
if: ${{ matrix.go-version == 'stable' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- uses: golangci/golangci-lint-action@v6
with:
version: latest