Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
gates:
name: gates (python ${{ matrix.python }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v4
with:
# FULL history, not a shallow clone. Two gates need it:
# * tests/conftest.py refuses to run against a partial file set,
# * test_the_commit_the_readme_cites_as_a_real_defect_exists resolves
# the commit hash README.md cites as a shipped board defect.
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
# Printed, not asserted — this is the context you want when a count gate
# fails, and it also makes an empty checkout obvious at a glance.
- name: Show what is being gated
run: |
echo "tracked files: $(git ls-files | wc -l)"
echo "board layouts: $(git ls-files '*.kicad_pcb' | wc -l)"
echo "schematics: $(git ls-files '*.sch' | wc -l)"
echo "plotted PDFs: $(git ls-files 'Boards/*.pdf' | wc -l)"
echo "renders: $(git ls-files 'Boards/*.jpg' | wc -l)"
echo "Fritzing SVGs: $(git ls-files 'Fritzing/*.svg' | wc -l)"
echo "markdown: $(git ls-files '*.md' | wc -l)"
- name: Run the gates
run: python -m pytest -v
# scripts/sync-docs.sh regenerates site/docs/ from docs/. If it reports
# drift, the committed site is stale and vulos.org is serving
# documentation this repo has already corrected.
#
# This is a SEPARATE check from the in-suite sync gate on purpose: this one
# proves the script is what produces the committed state, not merely that
# the two trees happen to match today.
#
# `--check` is read-only (it used to not exist: this step ran the script
# for real, which always wrote, and relied on the later
# "did CI modify the working tree" step to notice — correct only because
# a CI checkout is thrown away either way, and blind to the script's own
# silent zero-coverage hole, since an empty docs/ produced a "clean" diff
# too by wiping and never repopulating the mirror in the same run).
- name: site/ is what sync-docs.sh produces
run: ./scripts/sync-docs.sh --check
# A gate that mutates the repo is a gate that cannot be trusted twice.
- name: The gates did not modify the working tree
run: |
changed=$(git status --porcelain)
if [ -n "$changed" ]; then
echo "::error::running CI modified the repository:" >&2
printf '%s\n' "$changed" >&2
exit 1
fi
echo "working tree clean"
# ── site/ render gate ──────────────────────────────────────────────────────
# Separate job: it needs node and a real browser, and none of the python
# gates above depend on it. A check that only ever runs on someone's laptop
# is a check that stops running, so this is wired in rather than documented.
site-render:
name: site render gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
# playwright is NOT vendored into the repo — installed here, linked in
# locally. scripts/package.json declares the version.
- name: Install playwright
working-directory: scripts
run: |
npm install --no-package-lock --no-audit --no-fund
npx playwright install --with-deps chromium
# Run FIRST. The self-test breaks each invariant on purpose and demands
# the check notices; if it does not, the clean run below means nothing.
- name: The checks can fail
run: node scripts/check-render.mjs --selftest
- name: index.html and docs.html render clean
run: node scripts/check-render.mjs
- name: The gate did not modify the working tree
run: |
changed=$(git status --porcelain)
if [ -n "$changed" ]; then
echo "::error::running the site gate modified the repository:" >&2
printf '%s\n' "$changed" >&2
exit 1
fi
echo "working tree clean"
d8cf54d45This file is pinned to the selected release. Download the original to open it in your design tool.