-
Notifications
You must be signed in to change notification settings - Fork 48
82 lines (77 loc) · 2.48 KB
/
Copy pathci.yml
File metadata and controls
82 lines (77 loc) · 2.48 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
# Cross-compile the full 6-combo matrix from a single ubuntu runner.
# CGO_ENABLED=0 is part of the product promise (§10.3 — pure-Go SQLite).
build:
name: build ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache: true
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: go build -trimpath ./...
# Run tests on each native host (cross-run isn't a thing for go test).
test:
name: test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Windows tests are not run — README promises macOS and Linux only.
# Windows binaries are still cross-compiled in the build job above.
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache: true
- name: Test
run: go test -race -count=1 ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache: true
# Install golangci-lint via go install so it gets compiled with the
# runner's Go 1.25 toolchain. The prebuilt v1.60 binary from
# golangci-lint-action was built with Go 1.23 and refuses to lint
# go.mod's 1.25 target; compiling from source makes the version
# check agree with the target.
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
- name: Run golangci-lint
run: golangci-lint run --timeout=5m
# Custom SQL-safety analyzer (§10b.0b / QUEST-18). Runs as go vet -vettool
# rather than a golangci-lint plugin (plugin wiring needs a CGO .so — deferred).
sqlcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache: true
- name: Build sqlcheck
run: go build -o sqlcheck ./cmd/sqlcheck
- name: Run sqlcheck over the full module
run: ./sqlcheck ./...