Shared GitHub Actions workflows for every repository in the OpenHPS
organisation. They replace 24 independently hand-forked main.yml files, which had drifted to the
point where only three of them shared a single line of history.
Callers pin the moving @v1 tag. A breaking change to any workflow gets a v2 tag, so a CI
change can never break 28 repositories at once.
Third-party actions used inside this repository are pinned to full commit SHAs with a trailing
# vNcomment. This repository is a supply-chain chokepoint for every OpenHPS package, which is the one place where tag mutability genuinely matters.
CI for a standard @openhps/* package: build, lint, test, docs, coverage reporting, GitHub Pages
deployment, and npm release.
| Input | Type | Default | Purpose |
|---|---|---|---|
node-versions |
string (JSON array) | '["22","24"]' |
Versions to build and test against |
release-node |
string | '22' |
Version used for lint, docs, release and artifact upload |
prebuild-script |
string | '' |
npm script that generates sources before build/lint/docs |
run-size-limit |
boolean | false |
Run npm run size after the build |
run-typedoc |
boolean | true |
Build the TypeDoc API documentation |
graphviz |
boolean | false |
Install Graphviz (required by typedoc-umlclass) |
services-compose |
string | '' |
Docker compose file bringing up test service containers |
publish-docs |
boolean | true |
Deploy docs to GitHub Pages from master |
publish-npm |
boolean | true |
Publish to npm from master (latest) and dev (dev) |
Both are optional; pass them with secrets: inherit.
| Secret | Used by |
|---|---|
NPM_TOKEN |
the release job |
CODECOV_TOKEN |
the report job (Codecov v5 needs it for reliable uploads) |
build (matrix) ──┬─> test (matrix) ──> report
└─> docs ──┐
lint ───────────────────────┼─> publish-docs
│
build, lint, test ──────────┴─> release
lint deliberately does not depend on build: it runs prebuild-script itself, so lint
feedback arrives in about a minute instead of after a full build.
Each of these fixes a concrete failure mode in the workflows this replaces.
- Every job runs
checkout→setup-node(cache: npm) →npm ci. Previously only the build job installed anything;quality,test_coverageanddocumentationrelied on anactions/cachehit for**/node_modulesand used the runner's default Node. On a cache miss they either failed confusingly or, worse, ran a lint step that silently matched nothing. node_modulesanddistare never cached. Build output moves between jobs as artifacts withif-no-files-found: error, so a missing artifact fails loudly.setup-nodecaches only~/.npm, which is content-addressed and keyed on the lockfile, so a miss costs time and never correctness. (The olddistcache key usedgithub.run_number, which can never hit on the job that writes it.)npm ci, nevernpm install. Thirteen repositories rannpm installand fourteen ran bareyarn install, both of which silently rewrite the lockfile in CI.lintrunsprebuild-script. The oldqualityjob ran type-aware ESLint rules while generated sources (src/threein core) were absent from the tree.
CI for the private npm-workspace roots (openhps-capacitor, openhps-cordova, openhps-web).
Installs once at the root and drives --workspaces --if-present for build, test and publish.
Inputs: node-versions, release-node, publish-npm. Secret: NPM_TOKEN.
Dependabot auto-merge. Uses dependabot/fetch-metadata plus gh pr merge --auto --squash, and only
auto-merges patch and minor updates to devDependencies, so any runtime dependency bump still
gets a human look.
This replaces a configuration that combined permissions: write-all with a blanket target: minor
auto-merge through a third-party action.
JOSS paper build for openhps-core only.
Note the path filter is docs/paper/**, not ./docs/paper/**. GitHub path patterns are
repository-root-relative and reject a leading ./, so the previous filter never matched and the
push/PR triggers had never once fired.
.github/workflows/ci.yml:
name: CI
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
ci:
uses: OpenHPS/workflows/.github/workflows/module.yml@v1
secrets: inherit
with: {}concurrency must be set in the caller — a reusable workflow cannot declare it.
Core vendors three.js into src/three before anything can compile, budgets its web bundles, and
renders UML class diagrams that need Graphviz on PATH:
jobs:
ci:
uses: OpenHPS/workflows/.github/workflows/module.yml@v1
secrets: inherit
with:
prebuild-script: 'build:three'
run-size-limit: true
graphviz: truejobs:
ci:
uses: OpenHPS/workflows/.github/workflows/module.yml@v1
secrets: inherit
with:
services-compose: 'test/docker-compose.ci.yml'jobs:
ci:
uses: OpenHPS/workflows/.github/workflows/monorepo.yml@v1
secrets: inherit
with: {}package-lock.jsoncommitted, and apackageManagerfield pinning npm.- Scripts:
build,lint,cover:ci, andbuild:typedoc(unlessrun-typedoc: false). cover:cimust write a non-emptytest-results.xmlandcoverage/cobertura-coverage.xml. The canonicaltest/.mocharc.ci.json+test/.mocha-multi-reporters.jsonpair does this; note that puttingreporterEnabledat the top level of.mocharc.jsondoes not, which is why the fleet published zero test results for years while CI consumed the file.bump:releaseandbump:developmentscripts (commit-and-tag-version) for the release job.