-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.03 KB
/
Copy pathci.yml
File metadata and controls
43 lines (39 loc) · 1.03 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
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
env:
# The whole point: no cgo, anywhere, ever.
CGO_ENABLED: "0"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: gofmt
run: test -z "$(gofmt -l . | grep -v '^internal/reference/' | grep -v '\.pb\.go$')"
- run: go vet ./...
- run: go build ./...
- name: go test -race
env:
CGO_ENABLED: "1" # -race requires cgo in the toolchain, not in our code
run: go test -race ./...
- name: go test (pure)
run: go test ./...
generate-clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: cmd/generate output is committed and current
run: |
go run ./cmd/generate -aliases -keywords -plpgsql
git diff --exit-code