-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 2.36 KB
/
Copy pathfrontend.yml
File metadata and controls
64 lines (56 loc) · 2.36 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
name: frontend
on:
push:
branches: [main]
paths:
- "frontend/**"
- ".github/workflows/frontend.yml"
pull_request:
paths:
- "frontend/**"
- ".github/workflows/frontend.yml"
jobs:
test:
runs-on: ubuntu-latest
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
# amplify_outputs.json is generated by a real `ampx` deploy and
# deliberately gitignored (frontend/.gitignore's `amplify_outputs*`) —
# main.tsx imports it directly (Amplify.configure(amplifyJson)), so
# the build cannot proceed without *a* copy. The example carries the
# same Cognito user_pool_id/user_pool_client_id already committed in
# plaintext as docker-compose.yaml's local-dev defaults — not secrets
# (a public SPA client has no client secret to leak) — real enough for
# CI to type-check and bundle against, not meant to point at anything
# but this app's own already-public dev Cognito pool.
- name: Provide amplify_outputs.json
run: cp amplify_outputs.example.json amplify_outputs.json
# `npm ci` (not `npm install`) everywhere else in this repo, but not
# here: @aws-amplify/backend-cli's dependency tree (needed for real
# Cognito auth-trigger Lambda deploys, see amplify/auth/resource.ts —
# not dead weight) pulls in AWS SDK v3 packages whose optional
# dependencies (fast-xml-parser, and others) resolve non-
# deterministically across otherwise-identical `npm install` runs —
# confirmed directly: two fresh installs from a cleared cache produced
# two completely different sets of packages `npm ci` then rejected as
# missing from the lock file. Same accepted trade-off bq-sink's
# Dockerfile already makes for the identical reason (see its own
# comment) — reproducible-from-lockfile installs aren't achievable for
# this dependency tree with the current npm resolver.
- name: Install
run: npm install
- name: Lint
run: npm run lint
- name: Test
run: npm test
# Runs tsc -b as part of the build — the type-check gate.
- name: Build
run: npm run build