-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (64 loc) · 2.27 KB
/
Copy pathci.yml
File metadata and controls
77 lines (64 loc) · 2.27 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
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
gate:
runs-on: ubuntu-latest
env:
# corepack auto-downloads the packageManager-pinned pnpm without an interactive prompt
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Need history + the base ref so Biome can diff changed files.
fetch-depth: 0
# pnpm@11 needs Node >=22.13. pnpm/action-setup runs its self-installer on the
# runner's own Node-20 action runtime (ignores setup-node), so it can't install
# pnpm 11. Use corepack instead: it runs as a normal step on the setup-node Node
# (24, from .nvmrc) and activates the pnpm version pinned in package.json#packageManager.
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- name: Enable pnpm (corepack)
run: corepack enable
- name: Cache pnpm store
uses: actions/cache@v5
with:
path: ~/.local/share/pnpm/store
key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: pnpm-store-
- name: Install
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm typecheck
- name: Unit tests
run: pnpm test
- name: Hermetic e2e
run: pnpm test:e2e
- name: Build smoke (renderer bundle)
run: pnpm build
- name: Web server parses
run: node --check web/server.mjs
- name: Biome (changed files only)
# A clean checkout fails a pristine `biome check .` on pre-existing dirt
# in untouched files, so we scope Biome to the diff. On a PR, diff against
# the target branch; on a push to main, the previous commit.
env:
PR_BASE: ${{ github.base_ref }}
PUSH_BEFORE: ${{ github.event.before }}
run: |
if [ -n "$PR_BASE" ]; then
BASE="origin/$PR_BASE"
elif git rev-parse --verify --quiet "$PUSH_BEFORE^{commit}" >/dev/null; then
BASE="$PUSH_BEFORE"
else
BASE="HEAD^"
fi
echo "Scoping Biome to files changed since $BASE"
BIOME_SINCE="$BASE" pnpm check:changed