Skip to content

CI pipeline

Alex Santisteban edited this page Oct 22, 2026 · 4 revisions

The template adds two GitHub Actions workflows to your repository. This page explains what they do and when.

Workflow File Triggers Calls
Rock pipeline .github/workflows/rock.yml push to main, pull request to main, manual canonical/rocks-actions → Rock.yaml
Threat monitor .github/workflows/threats.yml daily at 01:00 UTC, manual canonical/rocks-actions → Security.yaml

Both pass the repository's secrets to the reusable workflows (secrets: inherit).

Rock pipeline

flowchart LR
    V[Validate] --> B[Build] --> T[Test] --> U[Upload]
    U -->|"if ghcr.upload: true"| G[GHCR]
    U -->|"if images[].registries is set"| X[Extra registries]
Loading

1. Validate

  • Reads and validates .github/ci.yaml. Any error here fails the run immediately, with a message pointing to the problem. See the CI configuration reference and Troubleshooting for guidance on how to solve these issues.
  • Expands the images list into a build matrix (one entry per rock) and an upload matrix (one entry per rock and extra registry).
  • Reads each rock's name, version and base to compute its image tag.
  • Chooses the runners for each architecture.

If an image's directory has no rockcraft.yaml, it is skipped with a warning. If no image remains, the Build, Test and Upload stages are skipped entirely and the pipeline succeeds. This is why a freshly created repository does not fail.

2. Build

For each rock, and each architecture in its platforms:

  1. Checks out your repository (using REPO_CLONER_TOKEN for private and internal repositories).
  2. Attaches Ubuntu Pro, if requested.
  3. Packs the rock with Rockcraft.
  4. Runs your spread tests, if the rock has a spread.yaml.

The per-architecture results are then assembled into a single multi-architecture OCI archive, stored as a workflow artifact. Pro-enabled artifacts are encrypted with your passphrase.

The artifact is named after the rock's directory (/ replaced by -), or after the rock's name when the rock is at the repository root. For Pro builds, the enabled services are appended (for example my-rock-0.1-24.04-esm-apps).

3. Test

Runs the generic checks on every built rock. A failure for one rock does not cancel the others.

4. Upload

Runs only when all of the following are true:

  • The Validate stage found at least one rock to build, and the Test stage succeeded.
  • The event is not a pull request.
  • The ref is main.

Then, per rock:

  • GHCR: if ghcr.upload is true, the image is pushed to ghcr.io/<owner>/<repository>/<name>:<tag> using the workflow's GITHUB_TOKEN. Pro-enabled rocks are not uploaded to GHCR from public repositories.
  • Additional registries: for each registry listed in the image's registries, the image is pushed to <uri>/<name>:<tag>.

On pull requests and on branches other than main, the pipeline stops after the Test stage, so nothing is published.

Tip

A manual run (workflow_dispatch) of the pipeline on main also uploads. Run it on another branch to build and test without publishing.

Threat monitor

Runs daily and on demand. If ghcr.cve-scan is enabled, it pulls each published image from GHCR, scans it for vulnerabilities and opens or updates a GitHub issue when it finds some.

Pinned versions

The template calls canonical/rocks-actions through a full commit SHA (with the release in a trailing comment), which in turn pins the workflows and actions it uses. This makes runs reproducible and protects you from unreviewed changes. To pick up fixes and features, bump the pin as described in Maintaining Your Repository.

Customizing

Almost everything you will want to change is in .github/ci.yaml:

  • which rock directories are built
  • whether to publish to GHCR
  • additional registries and their credentials
  • Ubuntu Pro services
  • whether to scan for vulnerabilities

The workflow files themselves normally do not need to be modified.

Clone this wiki locally