Version control and review Required
Run the checks on every change
Run the full check on a clean machine for every push and pull request, not only on a developer's computer.
How to do it
Use a CI service, such as GitHub Actions or GitLab CI. Start from a clean checkout, install from the lock file and run the same script as the deploy. Pin each outside action to a full commit hash, and give the job read-only access, as build secrets explains. Set a time limit on the job, and cancel older runs for the same branch. Include the formatter in its check mode. Keep it fast, so people wait for it instead of skipping it.
Example
# .github/workflows/check.yml
name: check
on: [push, pull_request]
permissions:
contents: read
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with: { node-version-file: .nvmrc }
- run: npm ci
- run: ./check.sh
How to check
Push a commit that breaks one test. The pull request shows a failed check before the job's time limit, such as 20 minutes.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers engineering playbook: https://agentwranglers.se/playbook/engineering/version-control-and-review/continuous-integration.