-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.65 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
name: PKG Build and Test
on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"
- name: Build
run: go build -v ./...
- name: Unit Tests
run: GORACE="log_path=$PWD/race" go test -race ./... -coverpkg=./... -coverprofile=coverage.txt
- name: Print Races
if: failure()
id: print-races
run: |
find race.* | xargs cat > race.txt
if [[ -s race.txt ]]; then
cat race.txt
fi
- name: Upload Go test results
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: go-test-results
path: |
./coverage.txt
./race.*
check-tidy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"
- name: Ensure "make gomodtidy" has been run
run: |
make gomodtidy
git add --all
git diff --minimal --cached --exit-code
- name: Ensure "make generate" has been run
run: |
make rm-mocked
make rm-builders
make generate
git add --all
git diff --stat --cached --exit-code