seriesoftubes/.github/workflows/ci.yml
Frederic Jung 98735eb769
Container image: releases only, a token by default, lean layers; every action pinned
The image is published to GHCR as the release's version when a release
dispatches docker.yml, and never as latest or per commit. Pushes and pull
requests that touch it build it and try headless (with and without a
token) and browser mode, without publishing.

The image: node:24-slim pinned by digest (the major CI tests on), npm ci
from the lockfile in its own layer, only src, site, scripts and the
harness copied in (an allow-list .dockerignore), root-owned and run as
node, /saves ready for --save-dir. The entrypoint runs the servers with
node directly and, with no SOT_MCP_TOKEN, makes a token for the run and
prints it (MCP_NO_TOKEN=1 to opt out); the docs publish ports to
127.0.0.1 and explain --allow-host. Labels, SBOM and provenance on push.

Every GitHub Action in every workflow is pinned to a commit SHA with its
version, and Dependabot keeps the actions, the image's base and the npm
tools current. tests/docker.test.js guards all of it. The ADR and the
github-pages skill say the image is a tool: GHCR only, never Pages.
2026-11-05 20:14:04 +01:00

71 lines
2.2 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# A newer push to the same pull request makes the older run pointless: cancel it instead of queueing behind it.
# Runs on main always finish.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# The tests in four parts of about equal time, each on its own runner, each running as many files at once as
# it has cores (scripts/test.js; the split comes from tests/durations.json).
part:
name: test ${{ matrix.part }}/4
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm test -- --shard ${{ matrix.part }}/4
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- run: npm ci
- name: Build (not deployed — only releases deploy)
run: npm run build
# The one check to look at, named as before: green only when every part and the build are.
test:
needs: [part, build]
if: always()
runs-on: ubuntu-latest
steps:
- name: Every part and the build passed
run: |
echo "parts: ${{ needs.part.result }}, build: ${{ needs.build.result }}"
test "${{ needs.part.result }}" = success && test "${{ needs.build.result }}" = success
translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- run: npm ci
- name: Translation coverage
run: node scripts/i18n-check.js --summary "$GITHUB_STEP_SUMMARY"