-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (66 loc) · 1.7 KB
/
test.yaml
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
67
68
name: test
on: [push]
jobs:
unittests:
runs-on: ubuntu-latest
timeout-minutes: 8
strategy:
fail-fast: false
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.20"
cache-dependency-path: "**/*.sum"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
**/**.sum
**/go.mod
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-test-${{ github.sha }}
restore-keys: |
go-test-
if: env.GIT_DIFF
- name: grip tests
run: go test -race ./...
if: env.GIT_DIFF
lint:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
cache-dependency-path: "**/*.sum"
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
**/**.sum
**/go.mod
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-test-${{ github.sha }}
restore-keys: |
go-test-
if: env.GIT_DIFF
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and
# must be specified with patch version: we always use the
# latest patch version.
version: v1.51.2
args: --timeout 5m
github-token: ${{ secrets.github_token }}
if: env.GIT_DIFF