-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.73 KB
/
Copy pathci.yml
File metadata and controls
58 lines (47 loc) · 1.73 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
name: CI
on:
push:
branches: [main, master]
pull_request:
jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Module graph
run: go mod download && go mod verify
- name: Vet
run: go vet ./...
# Integration tests are gated on CRDB_DSN and skip silently without it. Start the
# same pinned dependencies used for local development so they actually run in CI.
- name: Start CockroachDB and Redis
run: docker compose up -d --wait --wait-timeout 120
- name: Apply schema
run: make migrate
- name: Test
env:
CRDB_DSN: postgresql://root@127.0.0.1:26257/defaultdb?sslmode=disable
REDIS_ADDR: 127.0.0.1:6379
run: |
set -o pipefail
go test ./... -count=1 -v 2>&1 | tee /tmp/test.log
# A skipped integration test looks identical to a passing one in a green build.
# That is how TestIntegration_SubmitDelayedTask stayed broken unnoticed, so treat
# any skip as a failure: with the dependencies up, nothing has a reason to skip.
- name: Fail if any test skipped
run: |
if grep -Eq '^[[:space:]]*--- SKIP' /tmp/test.log; then
echo "::error::Tests were skipped. Integration tests must run in CI — check CRDB_DSN and dependency health."
grep -E '^[[:space:]]*--- SKIP' -A 1 /tmp/test.log
exit 1
fi
echo "No skipped tests."
- name: Build
run: go build -o /dev/null ./cmd/...
- name: Dependency logs
if: failure()
run: docker compose logs --no-color --tail=200