ENG-16Recommended
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. Include the security scanners too. They are the dependency audit of Lock and audit dependencies, the static scan of Scan every change for known mistakes and a secret scanner. Keep it fast, so people wait for it instead of skipping it. One tested pick is Use GitHub Actions for continuous integration.
Examples
YAML 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.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.
Sources
Related rules
- APS-74 Keep secrets out of builds from strangers in Application security
- ARC-67 Format all code with one tool in Clean code and architecture
- APS-69 Lock and audit dependencies in Application security
- SEC-8 Scan every change for known mistakes in Adversarial testing
- STK-52 Use GitHub Actions for continuous integration in Software choices
- ENG-55 Lock every CI action and its dependencies to a reviewed commit in Engineering
- ENG-41 Keep untrusted text out of CI scripts in Engineering
- INF-38 Scan infrastructure code on every change in Infrastructure and environments
- CMP-34 Collect evidence automatically in Compliance and governance
- DEN-3 Build every warehouse table from reviewed code in Data engineering
- TDD-10 Check how the team reviews AI-written code in Technical due diligence
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/engineering/version-control-and-review/continuous-integration">Agent Wranglers engineering playbook</a>. In code you write, add a comment next to it with the same link.