-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.83 KB
/
Copy pathci.yml
File metadata and controls
79 lines (64 loc) · 2.83 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
name: CI
on:
push:
branches: [main, master]
pull_request:
permissions:
contents: read
jobs:
check:
strategy:
fail-fast: false
matrix:
# The lower bound is what package.json claims in "engines". Node 20 is
# not on the list because jsdom, commander and tsdown all require 22+,
# and the odd-numbered lines are absent because jsdom does not support
# them.
os: [ubuntu-latest]
node-version: [22, 24, 26]
# This tool globs paths, writes them into reports and matches baselines
# against them, and a good share of the people it is for work on
# Windows. Reading the path handling is not the same as running it, so
# one job per other platform runs the whole suite there.
include:
- os: windows-latest
node-version: 24
- os: macos-latest
node-version: 24
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
# Browser mode is covered by the test suite, so the runner needs the
# binary. Playwright itself is a devDependency; the browser is not.
- name: Install Chromium for the browser-mode tests
run: npx playwright install ${{ runner.os == 'Linux' && '--with-deps' || '' }} chromium
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test
# Runs the bundled CLI. The test suite imports from src, so a path that
# only breaks after bundling is invisible to it.
- run: pnpm smoke
# Runs the packed tarball from outside the project it audits, which is
# the arrangement npx creates and the one three shipped browser-mode bugs
# needed. Every other job here runs inside this repo, where Playwright
# sits next to the code and none of them could reproduce.
- name: Run the packaged CLI the way an install does
run: node scripts/test-packaged.mjs
# examples/ is generated output, checked in so the formats can be read as
# whole documents. Regenerating it here makes it a test: a change to the
# code that moves a byte of what the tool prints has to show up in the
# diff and be explained, and a refactor claiming to change nothing has to
# prove it. One platform, because the assertion is about the code rather
# than the runner, and a path separator or line ending would fail this on
# Windows for reasons that say nothing about the change under review.
- name: Check examples/ still matches what the code produces
if: runner.os == 'Linux' && matrix.node-version == 24
run: |
pnpm examples
git diff --exit-code examples/