-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (45 loc) · 1.3 KB
/
Copy pathci.yml
File metadata and controls
47 lines (45 loc) · 1.3 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test
# Cross-environment smoke test: catches regressions where a published
# package fails to import under a specific Node version or loader.
# Motivated by 0.3.1 #1 (`Dynamic require of "semver" is not supported`)
# and the ESM-only ansi-tokenize / marked CJS-require crash discovered
# alongside it. Runs each built package through ESM, CJS, and tsx loaders
# on Node 18 / 20 / 22.
smoke:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
loader: [esm, cjs, tsx]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm --filter smoke-imports smoke:${{ matrix.loader }}