Repository navigation
62 lines (50 loc) · 1.97 KB
/
Copy pathci.yml
File metadata and controls
62 lines (50 loc) · 1.97 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
name: CI
on:
push:
branches: [main, develop]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install asdf-managed tools
uses: asdf-vm/actions/install@v4
- name: Install dependencies
run: npm ci
# @cfp/shared's exports map points at dist/. Build it first so type-check,
# lint, and test can resolve `@cfp/shared` / `@cfp/shared/schemas`.
- name: Build @cfp/shared
run: npm run -w packages/shared build
# Published schema contracts must match the Zod schemas; a change under
# a published version needs a version bump (specs/behaviors/storage.md).
- name: Check schema contracts
run: npm run -w packages/shared check-contracts
- name: Type check
run: npm run type-check
- name: Lint
run: npm run lint
- name: Test
run: npm test
# Tests seed from apps/api/gitsheets/; fail if that copy drifts from
# the data repo's `empty` branch, which production configs descend from.
# codeforphilly-data is private: this needs a read-only deploy key in
# CFP_DATA_DEPLOY_KEY, and warns instead of failing without one.
- name: Check sheet configs against codeforphilly-data
env:
CFP_DATA_DEPLOY_KEY: ${{ secrets.CFP_DATA_DEPLOY_KEY }}
run: |
if [ -z "$CFP_DATA_DEPLOY_KEY" ]; then
echo "::warning title=Sheet-config drift check skipped::CFP_DATA_DEPLOY_KEY is not set, so CI can't read the private codeforphilly-data repo."
exit 0
fi
mkdir -p "$HOME/.ssh"
printf '%s\n' "$CFP_DATA_DEPLOY_KEY" > "$HOME/.ssh/id_ed25519"
chmod 600 "$HOME/.ssh/id_ed25519"
ssh-keyscan github.com >> "$HOME/.ssh/known_hosts"
npm run -w apps/api check:sheet-configs
- name: Build
run: npm run build