Files
Scott Lamb 43d8a7e43a build fix: pin pnpm, move build-script approvals to pnpm-workspace.yaml
CI installed pnpm unpinned (`npm i -g pnpm`), so it picked up pnpm 11 --
released 2026-04-28, after v0.7.31 built fine on pnpm 10 -- and the Node
24 job failed with ERR_PNPM_IGNORED_BUILDS. pnpm 11 changed the default
of `strictDepBuilds` to true, so unapproved dependency build scripts are
a hard error rather than a warning.

Approve them in pnpm-workspace.yaml. pnpm 11 removed
`onlyBuiltDependencies` in favor of `allowBuilds`, and no longer reads
settings from the `pnpm` field of package.json at all; see
https://github.com/pnpm/pnpm/releases/tag/v11.0.0. The `packages` entry
keeps older pnpm from rejecting the file outright ("packages field
missing or empty").

Pin the pnpm version in both workflows so the next major doesn't land
unannounced; pnpm 12 is already in release candidates.

Drop Node 20 from the CI matrix. It reached end-of-life 2026-04-30, and
pnpm 11 requires Node >= 22.13 -- on Node 20 it dies with
ERR_UNKNOWN_BUILTIN_MODULE, so that job could not have passed anyway.
2026-08-14 17:57:23 -07:00

89 lines
2.7 KiB
YAML

name: CI
on: [push, pull_request]
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
MOONFIRE_COLOR: always
RUST_BACKTRACE: 1
jobs:
rust:
name: Rust ${{ matrix.rust }}
strategy:
matrix:
rust: ["stable", "1.91", "nightly"]
include:
- rust: nightly
extra_args: "--features nightly --benches"
- rust: stable
extra_components: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# `git describe` output gets baked into the binary for `moonfire-nvr --version`.
# Fetch all revs so it can see tag history.
fetch-depth: 0
filter: "tree:0"
- name: Cache
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
server/target
key: cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ matrix.rust }}-
cargo-
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: ${{ matrix.extra_components }}
rustflags: "" # don't override .cargo/config.toml flags.
- name: Test
run: |
cd server
cargo test --features=rusqlite/bundled ${{ matrix.extra_args }} --all
continue-on-error: ${{ matrix.rust == 'nightly' }}
- name: Check formatting
if: matrix.rust == 'stable'
run: cd server && cargo fmt --all -- --check
js:
name: Node ${{ matrix.node }}
strategy:
matrix:
# Node 20 is dropped: it reached end-of-life 2026-04-30, and pnpm 11
# requires Node >= 22.13 (it crashes on 20 with
# ERR_UNKNOWN_BUILTIN_MODULE).
node: ["22", "24", "25"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
# Install pnpm then use pnpm instead npm. Pin the version: an unpinned
# install silently picked up new majors, which is how pnpm 11 broke this
# job. Bump deliberately, checking the changelog.
- run: npm i -g pnpm@11.21.0
- run: cd ui && pnpm i --frozen-lockfile
- run: cd ui && pnpm run build
- run: cd ui && pnpm run test
- run: cd ui && pnpm run lint
- run: cd ui && pnpm run check-format
license:
name: Check copyright/license headers
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py