forked from AlmanacCode/codealmanac
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.53 KB
/
Copy pathci.yml
File metadata and controls
50 lines (41 loc) · 1.53 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
name: ci
# Runs on every push (any branch) and every pull request. Covers the full
# verification loop — install, build, typecheck, test — so red builds surface
# on the first commit, not at release time. Release is handled separately in
# publish.yml (tag-triggered).
on:
push:
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
# One cell failing shouldn't cancel the others — we want to see which
# OS/Node combinations regress independently.
fail-fast: false
matrix:
# Linux and Windows are both first-class targets. macOS shares the
# POSIX path with Linux, so it isn't a separate cell here.
os: [ubuntu-latest, windows-latest]
# package.json declares `engines.node: >=20`. We test 20 (minimum) and
# 22 (current LTS) so both supported versions stay green. Extending
# to newer LTS is ~30s of extra runtime, which is worth the coverage.
node-version: [20, 22]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# Built-in npm cache — keyed on package-lock.json. Saves ~20-30s
# on warm runs vs re-downloading every dependency.
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Typecheck
run: npx tsc --noEmit
- name: Test
run: npm test