Skip to content

docs(v0.11-M54-G): post-IMPL refactor-audit — file R-v0.11-NEW-5/6 + … #149

docs(v0.11-M54-G): post-IMPL refactor-audit — file R-v0.11-NEW-5/6 + …

docs(v0.11-M54-G): post-IMPL refactor-audit — file R-v0.11-NEW-5/6 + … #149

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
# Cancel in-flight runs of the same workflow on the same ref.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: typecheck / lint / test (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['22', '24']
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Test (with coverage)
run: npm run test:coverage
- name: Upload coverage artifact
if: matrix.node == '22'
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/
if-no-files-found: ignore
build:
name: build artifact
runs-on: ubuntu-latest
needs: quality
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- name: Build
run: npm run build
- name: Smoke-test compiled CLI
run: |
node dist/cli/index.js --version
node dist/cli/index.js --help
# `npm pack` produces the same tarball `npm publish` would
# upload — extracting and running the bin from there catches
# `package.json` "files"/"bin" regressions that `dist/`-relative
# smoke tests miss. Lifted from M7 to M2 per `v0.1-plan.md`
# §8 decision 4: it costs nothing to run early, and a
# broken-tarball regression discovered at release is far more
# painful than one discovered now.
- name: Pack tarball
id: pack
run: |
tarball=$(npm pack --silent)
echo "tarball=$tarball" >> "$GITHUB_OUTPUT"
echo "Built $tarball"
- name: Smoke-test packed tarball
run: |
set -eux
rm -rf /tmp/monday-cli-pack-test
mkdir -p /tmp/monday-cli-pack-test
cd /tmp/monday-cli-pack-test
tar -xzf "$GITHUB_WORKSPACE/${{ steps.pack.outputs.tarball }}"
# The tarball extracts into ./package. `npm pack` tarballs
# don't (and shouldn't) include node_modules, and the bin
# imports commander at startup — so we have to install
# runtime deps before the bin can run at all. The
# post-install invocation pulls double duty:
# 1. "bin entry resolves" — a future change that drops
# dist/ from package.json "files" surfaces here as
# `Cannot find module '.../dist/cli/index.js'`,
# which is distinct from the missing-package error
# you'd see if a runtime dep was unlisted.
# 2. "runtime dep set is complete" — installing with
# --omit=dev catches a refactor that accidentally
# imports a devDep on a runtime path, before it
# reaches end users.
# --ignore-scripts skips the `prepare` hook that would
# re-run `tsc` (devDep, not present here); the tarball
# already ships dist/.
cd package
npm install --omit=dev --ignore-scripts --no-package-lock --silent
node dist/cli/index.js --version
node dist/cli/index.js --help