The last piece of ci.yml supplies the database. A service container is started by the runner before the job's first step, on a private Docker 514 network, and removed after the last:
services:
postgres:
image: postgres:18
env: {POSTGRES_USER: booknest, POSTGRES_PASSWORD: booknest, POSTGRES_DB: booknest}
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U booknest" --health-interval 5s
--health-timeout 3s --health-retries 10The job runs on the runner itself, so ports puts PostgreSQL 1,289 on localhost:5432, the default in db/index.js (a job in a container: would use the host name postgres). The health check makes the runner wait until the log says postgres service is healthy. Service containers need a Linux runner.
With booknest/tests now reported for real, the "Require tests" ruleset (Required Checks) is switched on, pinned to the GitHub Actions 29 app (id 15368) so that no other integration can report a check of that name:
gh api -X PUT repos/{owner}/{repo}/rulesets/23992941 --input - \
--jq '{enforcement, checks: .rules[0].parameters.required_status_checks}' <<'EOF'
{"enforcement": "active", "rules": [{"type": "required_status_checks", "parameters": {
"strict_required_status_checks_policy": false,
"required_status_checks": [{"context": "booknest/tests", "integration_id": 15368}]}}]}
EOF{"checks":[{"context":"booknest/tests","integration_id":15368}],"enforcement":"active"}Pull request #18 then added a ?minRating= filter that compared with > instead of >=. Its new test failed (actual: [ 3 ], expected: [ 1, 3 ]) in every job, gh 29 pr checks 18 listed booknest/tests as fail and package as skipping, and the merge was refused:
gh pr merge 18 --squashX Pull request binarybehemoth/booknest#18 is not mergeable: the base branch policy prohibits the merge. ...
A second commit fixed the comparison, the required check passed, and the same command merged the pull request as aa96e69. The owner could have forced it with --admin (Bypass Actors), for emergencies only. No tarball was built for the failing code, because package needs test.