- Widen engines range to >=24 <27 - Test against Node 24 and 26 in CI (build/deploy artefacts remain on 24) - Replace unmaintained 'cbor' dependency with 'cbor2': the cbor package's synchronous encode relies on a single stream read() returning the whole encoding, which breaks on Node 26 where readable streams return one buffer at a time - Remove stale dependabot ignore for the removed cbor package - Update Node.js support notes in README and AGENTS
79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: "Master Build, Test & Deploy"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
main:
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# Node 24 is the officially supported version; Node 26 is tested
|
|
# ahead of it becoming the active LTS release (see #2397)
|
|
node-version: [24, 26]
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Set node version
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
- name: Install
|
|
run: |
|
|
npm ci
|
|
npm run setheapsize
|
|
|
|
- name: Lint
|
|
run: npx grunt lint
|
|
|
|
- name: Unit Tests
|
|
run: |
|
|
npm test
|
|
npm run testnodeconsumer
|
|
|
|
- name: Production Build
|
|
if: success()
|
|
run: npx grunt prod --msg=""
|
|
|
|
- name: Generate sitemap
|
|
run: npx grunt exec:sitemap
|
|
|
|
- name: Setup Chrome
|
|
id: setup-chrome
|
|
if: success()
|
|
run: |
|
|
npx @puppeteer/browsers install chrome@148
|
|
echo chromedir=$(dirname $(find `pwd`/chrome/* -name chrome -print -quit)) >> $GITHUB_OUTPUT
|
|
|
|
- name: UI Tests
|
|
if: success()
|
|
run: |
|
|
export PATH=${{ steps.setup-chrome.outputs.chromedir }}:$PATH
|
|
sudo apt-get install xvfb
|
|
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
|
|
|
- name: Prepare for GitHub Pages
|
|
if: success() && matrix.node-version == 24
|
|
run: npx grunt copy:ghPages
|
|
|
|
- name: Deploy to GitHub Pages
|
|
if: success() && github.ref == 'refs/heads/master' && matrix.node-version == 24
|
|
uses: crazy-max/ghaction-github-pages@1d6ee9b181a81033a16bd707a1401afa978daab4 # v5.0.0
|
|
with:
|
|
target_branch: gh-pages
|
|
build_dir: ./build/prod
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|