Repository navigation
113 lines (100 loc) · 3.64 KB
/
Copy pathci.yml
File metadata and controls
113 lines (100 loc) · 3.64 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on:
push:
branches: [main]
pull_request:
schedule:
# A weekly broader property-test sweep. Pull requests run fixed seeds so
# they are reproducible; this run varies them to find what fixed seeds miss.
- cron: "17 4 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: test (${{ matrix.os }}, node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: ["22", "24"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Unit and example tests
run: npm test
# The public API is whatever packages/*/etc/*.api.md says it is. A change
# to an exported signature fails here until the report is regenerated
# (npm run api) and committed - so an API change is a reviewed diff, never
# a side effect. Platform-independent, so it runs once.
- name: Public API matches the committed report
if: matrix.os == 'ubuntu-latest' && matrix.node == '24'
run: npm run api:check
# A docs script that fails is worse than no docs script, and this one
# already caught a public type that was reachable but not exported.
- name: Generate API documentation
if: matrix.os == 'ubuntu-latest' && matrix.node == '24'
run: npm run docs
# The real gate: does the thing we would publish work for someone who
# installs it? Runs on every platform, because packaging bugs are
# frequently platform-specific.
- name: Verify packaged install and README example
run: npm run verify:packaged
# The Next.js recipe, on its own. Next is a ~300 MB install plus a build,
# so it has a separate package and lockfile rather than joining the
# workspace, and the six jobs above never install it. One platform is
# enough: what this checks is the recipe's wiring, and the other recipes
# already cover the platforms.
recipe-nextjs:
name: recipe (Next.js)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: |
package-lock.json
examples/frameworks/nextjs/package-lock.json
- run: npm ci
- run: npm ci --prefix examples/frameworks/nextjs
# Builds the library the scenario imports; the recipe's own typecheck
# runs inside test:nextjs.
- name: Typecheck
run: npm run typecheck
- name: Build and test the Next.js recipe
run: npm run test:nextjs
property-sweep:
name: property sweep (varied seeds)
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: npm
- run: npm ci
- name: Planner properties with many runs
env:
# fast-check reads this to widen the search beyond the PR default.
EVENTLAB_PROPERTY_RUNS: "2000"
run: npx vitest run packages/core/test/createPlan.test.ts
- name: Retain counterexamples
if: failure()
uses: actions/upload-artifact@v4
with:
name: property-failures
path: |
**/*.log
packages/core/test/**/__counterexamples__/**
if-no-files-found: ignore
retention-days: 30