-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 2.19 KB
/
Copy pathci.yml
File metadata and controls
63 lines (53 loc) · 2.19 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get pnpm store path
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- run: pnpm install --frozen-lockfile
# The real packages/worker/wrangler.toml is gitignored; CI
# materializes a syntactically-valid stand-in from the committed
# template. Values are deliberately fake — pnpm build runs
# `wrangler deploy --dry-run` which only validates parse + types,
# not Cloudflare account state. Forks running this workflow on
# PRs don't have access to repo Variables, so we don't read them
# here either; deploy.yml is the only workflow that touches real
# values.
- name: Render wrangler.toml stub for build
run: |
set -euo pipefail
TEMPLATE=packages/worker/wrangler.toml.example
OUT=packages/worker/wrangler.toml
cp "$TEMPLATE" "$OUT"
sed -i "s|REPLACE_ME_AFTER_wrangler_d1_create|00000000-0000-0000-0000-000000000000|" "$OUT"
# Cache the AS Lite tarball across runs -- 61 MB pulled from a GH
# release on every run otherwise. Key on the pinned version +
# checksum so a bundle bump invalidates the cache automatically.
- name: Cache AdvantageScope Lite bundle
uses: actions/cache@v4
with:
path: packages/web/.advantagescope-cache
key: advantagescope-${{ hashFiles('packages/web/advantagescope/version.txt', 'packages/web/advantagescope/checksums.txt') }}
- run: pnpm fetch:advantagescope
- run: pnpm typecheck
- run: pnpm build # web must build before worker (worker bundles web/dist via [assets])
- run: pnpm test
- run: pnpm lint