Skip to content

ManualContinuous integration

Run GitHub Actions

Run your tests on GitHub before Berrit lands a change.

By the time your change is ready to land, there may be other changes ahead of it. Berrit combines your work with theirs to make a candidate commit. Let’s have GitHub run the tests on that commit before Berrit lands it. How checks work covers the other times you might want to run tests.

First, connect the repository through the GitHub App. The installation owner needs to accept read and write access for Actions on GitHub so Berrit can start a run. If your pull request jobs already test the train candidate, Berrit can use their results instead. Use existing CI jobs

Commit .github/workflows/berrit-ci.yml to your default branch on GitHub so GitHub can find it by name. GitHub runs the copy of the file on the commit Berrit sends. If your changes land on a release branch, make sure the workflow is present there too.

Our example tests a Node.js project with a committed package-lock.json and an npm test script. Keep the dispatch trigger and the checkout, then use the same setup and test commands you use locally. For this manual, for instance, we’d keep npm ci and use npm run build to check that Astro can render the guides.

.github/workflows/berrit-ci.yml
name: Candidate tests
on:
workflow_dispatch:
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: 24
- run: npm ci
- run: npm test
Download berrit-ci.yml

Berrit sends no inputs for this test. Leave the checkout on its default ref so the job tests the commit Berrit asked GitHub to build. The GitHub App needs permission to start the run, but the job itself only needs contents: read. A push check can run the author’s edits to the workflow before anyone has reviewed them. Keep any secrets that code shouldn’t read out of reach of those runs.

The workflow’s on: workflow_dispatch lets Berrit start a run on GitHub. The on field in checks.toml answers a different question. When do you want Berrit to ask for that run, and which code do you want it to test?

Stage When Berrit asks for a run What the workflow tests
push Each time you send a new revision to Berrit. Useful for quick feedback while you’re editing. The revision you just sent.
approved When that revision first meets the repository’s review requirements. Useful for expensive tests you’d rather run after review. The approved revision.
train When the merge train tests a candidate for landing. Your change combined with the current target branch and any changes ahead of yours in the queue.

You can choose more than one stage. For example, on = ["push", "train"] gives you feedback on each revision and runs the workflow again on the combined code. If you choose both push and approved, approval starts another run even when the revision hasn’t changed. A required push or approved check must pass before the change can enter the train. A required train check must pass before the candidate can land.

For this example we only want the final test, so we’ll use on = ["train"]. Add the block below to checks.toml at the root of the target branch. If you already have a check for these tests, edit it in place. If it used to wait for a job GitHub started, replace its app entry with workflow.

checks.toml
[[check]]
name = "candidate-tests"
on = ["train"]
paths = ["**"]
required = true
timeout = "30m"
workflow = "berrit-ci.yml"

Here, workflow names the file in .github/workflows/. Once the run starts, Berrit waits up to 30 minutes for the whole workflow to pass and shows its result under candidate-tests on the change. With paths = ["**"], the check applies to every path. Narrow that list if you only need this test when particular files change. Check fields

  1. Once checks.toml is on the target branch, send a change that touches one of the configured paths. A change proposing the check is still reviewed under the old configuration. Choose Land after approval, or Land when ready while approval is pending.
  2. Open the repository’s Train tab and select the change number.
  3. In the change’s Checks panel, find candidate-tests at the train stage. Details takes you to that run on GitHub. Once the required checks pass, the train can land the candidate you just tested.

If no run appears on GitHub, check the filename, trigger and App permissions. Troubleshoot setup