Pipelines
Several pipelines in one repository
Split a repository's CI into several files, and know which checks each one reports and which to require.
Available in repositories branchd reads pipeline files for. It is switching repositories on one at a time: until yours is, it keeps running its
.forge-ci.yamlor.xeonr-ci.yaml. See What is available.
# .branchd/pipelines/ci.yaml
# Checks: "CI / test" and "CI / lint" on every push and pull request.
name: CI
on: [push, pull_request]
jobs:
test:
image: golang:1.26
steps:
- run: go test ./...
lint:
image: golangci/golangci-lint:v2.1
steps:
- run: golangci-lint run
# .branchd/pipelines/release.yaml
# Checks: "Release / binaries" on tags v1.2.3 and the like only.
name: Release
on:
push:
tags: ['v*']
jobs:
binaries:
image: golang:1.26
steps:
- run: GOOS=linux GOARCH=amd64 go build -o dist/app-linux-amd64 ./cmd/app
- run: GOOS=darwin GOARCH=arm64 go build -o dist/app-darwin-arm64 ./cmd/app
artifacts: [dist]
# .branchd/pipelines/docs.yaml
# Checks: "Docs / build", only when docs/ changes.
name: Docs
on:
push:
paths: ['docs/**']
pull_request:
paths: ['docs/**']
jobs:
build:
image: node:24
steps:
- run: npx --yes markdownlint-cli2 'docs/**/*.md'
- One file, one pipeline, one run. For each event, every file whose
on:matches gets a run of its own. A file that does not match has no run, andplannotes why. - Each file is compiled on its own. A file with a mistake is refused, with its own error, and the others still run.
- Names. A pipeline's name is its
name:, else the file name without.yaml; 1 to 64 characters with no/. Two files with one name are refused. - Checks are named
<pipeline> / <job>, the job as the file names it:CI / test,Release / binaries,Docs / build. A matrix cell adds its values:CI / test (1.26),CI / cell (1, x). A job of a called pipeline adds the calling job:CI / deploy / apply. A part of a job with an isolated step isCI / build [1/2]. A pipeline named exactlycihas bare check names (test), as the old files' did, unless the name holds/(ci / lib / prep). - No needs across files. A job needs only jobs of its own file. To share work, use a reusable pipeline.
Required checks
A branch rule can require checks before a pull request merges. A required check that a pull request's run never reports keeps the pull request from merging, and branchd names it as missing. So require only checks that run on every pull request to that branch:
- require
CI / testandCI / lint, whose pipeline runs on every pull request; - do not require
Docs / build(filtered bypaths:) or any job whoseif:can be false on a pull request; - renaming a pipeline or a job renames its check: change the rule with it.