-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (29 loc) · 975 Bytes
/
github-actions.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
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# last 2 major versions are supported
# https://go.dev/doc/devel/release#policy
go-version: ['1.21', '1.22']
steps:
- uses: actions/checkout@v4
- name: Using Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Lint
if: ${{ matrix.go-version == '1.22' && matrix.os == 'ubuntu-latest' }}
uses: golangci/golangci-lint-action@v6
- name: Test
run: go test -v -race ./... -covermode atomic -coverprofile coverage.out
- name: Upload coverage to Codecov
if: ${{ matrix.go-version == '1.22' && matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}