-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 2.48 KB
/
Copy pathci.yml
File metadata and controls
86 lines (80 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
83
84
85
86
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# Force JavaScript-based actions onto Node.js 24 ahead of the
# 2026-06-02 default flip; silences the Node 20 deprecation banner.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: "1.25"
cache: true
- uses: golangci/golangci-lint-action@v9
with:
# Pinned exact (not v2.5). Keep in sync with Makefile
# GOLANGCI_LINT_VERSION.
version: v2.5.0
test-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.25", "1.26"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}
cache: true
- run: go vet ./...
- run: go test -race -count=1 ./...
test-integration-linux:
runs-on: ubuntu-latest
needs: [lint, test-linux]
strategy:
fail-fast: false
matrix:
go: ["1.25", "1.26"]
shard: [1, 2, 3]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}
cache: true
- name: Verify Docker available
run: |
docker version
docker compose version
- name: Run integration tests (shard ${{ matrix.shard }}/3)
env:
SHARD_INDEX: ${{ matrix.shard }}
SHARD_TOTAL: 3
run: |
# Enumerate tests under the integration tag, partition them
# deterministically by sorted-index modulo SHARD_TOTAL, and
# run only this shard's subset. Platform-specific tests are
# excluded here by their build constraints.
set -euo pipefail
tests=$(go test -tags=integration -list '.*' ./test/integration/... \
| grep -E '^Test' | sort -u)
if [ -z "$tests" ]; then
echo "no integration tests discovered" >&2
exit 1
fi
selected=$(echo "$tests" | awk -v s="$SHARD_INDEX" -v t="$SHARD_TOTAL" \
'{ if ((NR - 1) % t == (s - 1)) print }')
echo "Shard ${SHARD_INDEX}/${SHARD_TOTAL} will run:"
echo "$selected"
pattern="^($(echo "$selected" | paste -sd '|' -))$"
go test -race -count=1 -tags=integration -timeout=15m \
-run "$pattern" ./test/integration/...