-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (116 loc) · 4.62 KB
/
Copy pathtest.yml
File metadata and controls
136 lines (116 loc) · 4.62 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
125
126
127
128
129
130
131
132
133
134
135
136
name: tests
# Verification gates that run on every push and PR to main. Three
# parallel jobs:
#
# python-tests → pytest against the poller Lambda + MCP server
# pure-function suites (see TESTING.md).
# web-typecheck → `tsc --noEmit` against the Next.js app. Catches
# type drift before it ships.
# cdk-synth → builds the CDK TypeScript and runs `cdk synth`
# to verify the infrastructure stacks still compile
# to valid CloudFormation.
#
# ESLint is NOT in CI yet — see TESTING.md "Known follow-ups."
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
python-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
# Match the Lambda runtime to keep test behavior aligned
# with production. Bump when the Lambda runtime moves.
python-version: '3.12'
cache: pip
# ── Data-growth invariants (fast-fail, no deps) ──────────────
# Fails the build on a new interactive table.scan() without a
# justification, or an unbounded-SK write without a ttl. Keeps the
# silent-data-growth failure class un-introducible. See
# DATA-GROWTH-MODEL.md.
- name: Check data-growth invariants
run: python tools/check_growth_invariants.py
# ── Poller test suite ────────────────────────────────────────
# Install the poller's runtime deps + pytest in an isolated
# step. The poller doesn't pull in the MCP SDK so this stage
# is lighter than the MCP one.
- name: Install poller dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r infra/lambda/poller/requirements.txt
# boto3 is provided by the Lambda runtime in production, so
# it's not in requirements.txt — installing it explicitly for
# CI's clean Ubuntu environment.
python -m pip install boto3 pytest
- name: Run poller tests
working-directory: infra/lambda/poller
run: pytest
# ── MCP server test suite ────────────────────────────────────
# Installs the MCP SDK (heavier). Keeping it as a separate
# step makes CI output easier to read when one suite fails.
- name: Install MCP dependencies
run: python -m pip install -r mcp/requirements.txt
- name: Run MCP tests
working-directory: mcp
run: pytest
web-typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
# Pinned to match web/package.json's `packageManager` field so
# CI and dev run byte-identical pnpm — prevents the version
# drift that broke this job in June 2026 (a pnpm-11 dev wrote a
# workspace file CI's floating pnpm 9 rejected). Bump both
# together.
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Install web dependencies
working-directory: web
run: pnpm install --frozen-lockfile
- name: Typecheck web
working-directory: web
run: pnpm typecheck
# Unit tests added 2026-05-25 with the GSI cutover. Initial
# coverage is the getParkRides() read path — the test-time
# layer of the three-layer defense documented in TESTING.md
# for the silent-data-growth regression category.
- name: Run web unit tests
working-directory: web
run: pnpm test
cdk-synth:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: infra/package-lock.json
- name: Install infra dependencies
working-directory: infra
run: npm ci
- name: Build infra TypeScript
working-directory: infra
run: npm run build
# --quiet suppresses the full CloudFormation template output
# (keeps the CI log readable) while still failing on errors.
- name: CDK synth
working-directory: infra
run: npx cdk synth --quiet