-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 2.45 KB
/
Copy pathgate.yml
File metadata and controls
63 lines (63 loc) · 2.45 KB
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
name: gate
on:
push:
branches: [main]
pull_request:
# Every check below runs a Makefile target, so `make gate` on a developer machine
# is these same commands in the same order — .NOTPARALLEL in the Makefile keeps
# that true under `make -j`. Lint is the one check that does not run a target:
# the action installs the pinned release and runs it, and the step above reads
# that pin back from the Makefile so the version still has a single definition.
# Add a check to the Makefile and give it a step here; do not spell a command out
# in this file.
jobs:
gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.3"
- name: gofmt
run: make fmt
- name: vet
run: make vet
- name: lint version
id: lint-version
run: echo "version=$(make -s print-lint-version)" >>"$GITHUB_OUTPUT"
- name: lint
uses: golangci/golangci-lint-action@v8.0.0
with:
# Pinned so a golangci-lint release cannot redden main without a commit,
# and so the nolint steps below describe the run that produced the
# findings above: they ask golangci-lint which linters it is running,
# which only answers for this step if it is the same build. The pin
# itself lives in the Makefile and is read back by the step above.
version: ${{ steps.lint-version.outputs.version }}
# The action leaves the golangci-lint it installed on PATH for later steps
# (core.addPath in its entrypoint), so these reach that same binary.
- name: nolint grammar
run: make nolint-grammar
- name: nolint directives
run: make nolint
- name: build
run: make build
- name: coverage counting
run: make coverage-count
- name: test (race detector, exactly 100% coverage)
run: make coverage
- name: fuzz
id: fuzz
run: make fuzz
- name: benchmarks
run: make bench-smoke
# A crash the fuzz step finds is written to <pkg>/testdata/fuzz/<Target>/
# in the runner's workspace and would otherwise die with it, leaving a red
# gate and no reproducer to commit.
- name: upload fuzz findings
if: failure() && steps.fuzz.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: fuzz-findings
path: "**/testdata/fuzz/**"
if-no-files-found: ignore