-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 2.55 KB
/
Copy pathnode-floor.yml
File metadata and controls
64 lines (60 loc) · 2.55 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
name: node-floor
# Starts the PACKED CLI on exactly the Node version `engines.node` declares as
# its floor. `package.json` once said ">=20" while @clack/prompts — a runtime
# dependency — imports `styleText` from node:util (20.12.0+), so on 20.0–20.11
# even `pharn --version` died at load time and nothing caught it: the six gates
# in ci.yml run node 24 only. The floor is 20.13.0, not 20.12.0, because clack
# also passes `styleText` an ARRAY of formats, which Node accepts only from
# 20.13.0 — on 20.12.x cancelling a confirm prompt crashed. `--version` does not
# reach that code, so tests/engines.test.ts is what catches it: it scans the
# dependencies' shipped code for known version-gated API uses.
#
# A SEPARATE workflow on purpose. ci.yml's six job names are a contract with the
# `main` branch ruleset (tests/ci-workflow.test.ts); matrixing one of them would
# rename its reported context and block every PR. This job's context
# (`Smoke (node floor)`) is additional and NOT required unless a maintainer adds
# it to the ruleset. The name carries no version so a floor bump never renames
# it. FLOOR below must equal package.json's lower bound — tests/engines.test.ts
# pins that equality.
#
# Build on node 24 (the toolchain's own floor is higher), then install the
# tarball — runtime dependencies are external to the bundle (scripts/build.mjs),
# so only an install exercises what a user actually runs.
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
smoke-node-floor:
name: Smoke (node floor)
runs-on: ubuntu-latest
env:
FLOOR: 20.13.0
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
- run: npm ci
- run: npm run build
- name: Pack
run: npm pack --pack-destination "$RUNNER_TEMP"
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.FLOOR }}
- name: Install the packed CLI on the floor Node
working-directory: ${{ runner.temp }}
run: |
node --version
mkdir smoke && cd smoke
npm init -y > /dev/null
npm install --no-audit --no-fund ../pharn-dev-pharn-*.tgz
- name: Start it
working-directory: ${{ runner.temp }}/smoke
run: |
./node_modules/.bin/pharn --version
./node_modules/.bin/pharn --help