-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.12 KB
/
Copy pathci.yml
File metadata and controls
51 lines (41 loc) · 1.12 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
name: CI
# The always-on quality bar: formatting, vet, build and the full offline test
# suite (with the race detector). The whole `go test ./...` is offline by design
# — it uses fakes and httptest, never a live LLM — so this runs on every push
# and PR with no secrets.
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: build · vet · test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: gofmt
run: |
unformatted="$(gofmt -l .)"
if [ -n "$unformatted" ]; then
echo "::error::These files are not gofmt-clean:"
echo "$unformatted"
echo "Run: gofmt -w ."
exit 1
fi
- name: go vet
run: go vet ./...
- name: go build
run: go build ./...
- name: go test (race)
run: go test -race -count=1 ./...