Record the deb -> PowerBook cutover in deployment-details.md #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: tests | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| pytest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - run: pip install -r requirements-dev.txt | |
| - run: python -m pytest | |
| # The static site is one file with no build step, so the only thing | |
| # CI can usefully say about it is whether it parses. | |
| - name: check the site's script parses | |
| run: | | |
| python - <<'PY' | |
| import pathlib, re, subprocess, sys | |
| html = pathlib.Path("index.html").read_text() | |
| script = re.search(r"^<script>\n(.*?)\n</script>", html, re.S | re.M) | |
| if not script: | |
| sys.exit("no <script> block found in index.html") | |
| pathlib.Path("/tmp/site.js").write_text(script.group(1)) | |
| subprocess.run(["node", "--check", "/tmp/site.js"], check=True) | |
| subprocess.run(["node", "--check", "extension/background.js"], check=True) | |
| subprocess.run(["node", "--check", "extension/content.js"], check=True) | |
| PY | |
| # The pure half of that script — routing, filtering, the derivations — | |
| # is fenced by banner comments and evaluated on its own, so it can be | |
| # tested without a browser. tests/site/extract.mjs does the slicing. | |
| # The files are named rather than the directory: node 22 tries to load | |
| # a bare directory argument as a module, where node 20 walked it. | |
| - name: the site's pure functions | |
| run: node --test tests/site/*.test.mjs | |
| - name: no secrets in the tree | |
| run: | | |
| if git grep -nE '\b[0-9a-f]{60}\b|\b[0-9]{8,10}:[A-Za-z0-9_-]{35}\b' \ | |
| -- . ':!docs' ':!tests'; then | |
| echo "possible credential committed" >&2 | |
| exit 1 | |
| fi |