-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (101 loc) · 3.08 KB
/
Copy pathci.yml
File metadata and controls
124 lines (101 loc) · 3.08 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
go:
name: Build / Vet / Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache: true
- name: go build
run: go build ./...
- name: go vet
run: go vet ./...
# Unit lane with the race detector (security.md mandates -race).
# Integration tests (//go:build integration) run in the separate
# `integration` job below — testcontainers needs a Docker daemon, which
# this job's runner does not assume. This lane is NOT a full-system pass.
- name: go test (race, unit)
run: go test -race ./...
integration:
name: Integration (race, testcontainers)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache: true
# ubuntu-latest provides a Docker daemon; testcontainers-go starts a
# pgvector/pgvector:pg17 container per package (internal/testdb) and
# applies migrations/. Mirrors `make test-integration` locally, with
# -count=1 to bypass the test cache so the integration suite always runs
# against the current tree (the cache can mask a regression on re-runs).
- name: go test (race, integration)
run: go test -race -count=1 -tags integration ./...
lint:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache: true
- uses: golangci/golangci-lint-action@v7
with:
# Pinned for reproducible lint results (was `latest`, non-reproducible).
version: v2.12.2
sqlc-drift:
name: sqlc drift
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache: true
- name: Install sqlc
run: go install github.com/sqlc-dev/sqlc/cmd/sqlc@v1.30.0
- name: sqlc generate
run: sqlc generate
- name: Fail on drift
run: |
if ! git diff --exit-code -- internal/db/; then
echo "::error::sqlc generate produced changes. Run sqlc generate locally and commit the generated files."
exit 1
fi
frontend:
name: Frontend build + lint
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: npm ci
run: npm ci
- name: npm run lint
run: npm run lint
- name: npm run build
run: npm run build