-
Notifications
You must be signed in to change notification settings - Fork 54
106 lines (92 loc) · 2.28 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
skip-check:
name: Skip check
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip-check.outputs.should_skip }}
permissions:
actions: write
contents: read
steps:
- id: skip-check
uses: fkirc/skip-duplicate-actions@v4
with:
do_not_skip: '["schedule", "workflow_dispatch"]'
paths: |-
[
"**.go",
".github/workflows/test.yml",
".go-version",
"go.mod",
"go.sum"
]
skip_after_successful_duplicate: false
lint:
runs-on: ubuntu-latest
name: Linters (Static Analysis) for Go
env:
GOBIN: /tmp/.bin
steps:
- name: Checkout code into the Go module directory.
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
- name: Format
run: make format
- name: Lint
run: make lint
test:
runs-on: ubuntu-latest
name: Run tests
env:
GOBIN: /tmp/.bin
steps:
- name: Check out code into the Go module directory.
uses: actions/checkout@v3
- name: Install Go.
uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
- name: Run unit tests
run: make test
test-tag-stringlabels:
runs-on: ubuntu-latest
name: Run tests --tags=stringlabels
env:
GOBIN: /tmp/.bin
steps:
- name: Check out code into the Go module directory.
uses: actions/checkout@v3
- name: Install Go.
uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
- name: Run unit tests
run: make test-stringlabels
fuzz:
runs-on: ubuntu-latest
name: Run fuzz
env:
GOBIN: /tmp/.bin
steps:
- name: Check out code into the Go module directory.
uses: actions/checkout@v3
- name: Install Go.
uses: actions/setup-go@v3
with:
go-version-file: .go-version
cache: true
- name: Run fuzzing
run: make fuzz