-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.03 KB
/
main.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
name: Check and test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
env:
# run coverage only with the latest Go version
LATEST_GO_VERSION: "1.21"
jobs:
test:
strategy:
matrix:
go-version: [ "1.19", "1.20", "1.21" ]
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code of this branch
uses: actions/checkout@v3
- name: Execute Go lint, check, test
run: |
make init
make check
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
- name: Upload coverage to Codecov
if: success() && matrix.go == env.LATEST_GO_VERSION && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false