...
1name: Unit Test Linux-X64
2
3on: push
4
5jobs:
6 build:
7 strategy:
8 matrix:
9 go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x]
10 runs-on: [self-hosted, X64]
11 steps:
12 - name: Clear repository
13 run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
14
15 - uses: actions/checkout@v2
16 with:
17 fetch-depth: 0
18
19 - name: Set up Go
20 uses: actions/setup-go@v2
21 with:
22 go-version: ${{ matrix.go-version }}
23
24 - uses: actions/cache@v2
25 with:
26 path: ~/go/pkg/mod
27 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28 restore-keys: |
29 ${{ runner.os }}-go-
30
31 - name: Unit Test
32 run: |
33 go test -race -covermode=atomic -coverprofile=coverage.txt ./...
34
35 - name: external
36 run: |
37 cd ./external_jsonlib_test
38 GOMAXPROCS=4 go test -v -race ./...
39
40 - name: Codecov
41 run: bash <(curl -s https://codecov.io/bash)
View as plain text