-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (55 loc) · 1.57 KB
/
go.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
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Every day at 8am.
- cron: "0 8 * * *"
# Cancel running workflows on new push to a PR.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: Build and test
strategy:
matrix:
go-version: ['1.21.x']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -covermode atomic -coverpkg ./... -coverprofile cover.out ./...
- name: Convert GOCOVERDIR coverage data
run: go tool covdata textfmt -i=cmd/mkuimage/cover -o cover2.out
- uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: '804457b0-03f8-4cf6-bc99-eaf43399177b'
with:
flags: ${{ matrix.platform }}-unit
fail_ci_if_error: true
verbose: true
race:
name: Race test
strategy:
matrix:
go-version: ['1.21.x']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Race
run: go test -race -v ./...