Skip to content

Continuous integration and develop publishing

This page covers ci.yml, runner-compatibility.yml, develop.yml, the fork pull request policy, and gate troubleshooting. Release and publish workflows are in Releases; security scans are in Security scanning.

ci.yml

Purpose:

  • run the repository test suite for all branches and pull requests

Triggers:

  • push to any branch (tags do not start it)
  • pull request targeting any branch

Behavior:

  • fails early on fork pull requests that do not carry the approved-for-ci label (the gate job, see Fork pull request policy)
  • uses ./.github/actions/suite-tests to set up Python, Go, and Lua (installed through APT), sync the Python workspace, and run the suite; the enable_cache: true input controls only the uv dependency cache — the action always runs with the Go cache off
  • runs tests with make test
  • builds the documentation with make build-docs. The build is strict, so a broken link, a broken anchor, or a page missing from the navigation fails the job; make build-docs checks the navigation first and then runs the Zensical build. It reuses the uv environment that suite-tests set up
  • summarizes the test and documentation-build commands and the final job status

Permissions:

  • top-level contents: read

runner-compatibility.yml

Purpose:

  • check the repository test suite on the pinned Ubuntu image and the next Ubuntu image

Triggers:

  • weekly schedule (30 3 * * 1)
  • manual dispatch

Behavior:

  • runs the shared repository test action on ubuntu-24.04 and ubuntu-26.04
  • keeps both matrix jobs independent: one image failing does not cancel the other (fail-fast: false)
  • uses no secrets and has read-only contents permission
  • writes a summary for each matrix job

develop.yml

The develop channel is the pre-release build of the platform: the develop-tagged images and the <VERSION>-develop Helm chart. Deploy it to a local development cluster or a staging environment to test a change before production. It is not a supported release.

Purpose:

  • publish develop-tagged images and the <VERSION>-develop Helm chart to the develop channel. The workflow runs only by manual dispatch, and the dispatcher selects the source branch. The Security workflow is advisory and does not block publishing

Triggers:

  • workflow_dispatch with a required branch input: the branch to build the develop images and Helm chart from. Dispatch the workflow from main and select the source branch in the input

Behavior:

  • the check-gate job first stops a run whose ref is not refs/heads/main. GitHub runs the workflow file from the selected ref, so only the main copy is authoritative. This step gives an early, clear error. The main-only deployment branch policy of the develop-publish environment is the control that enforces it, because a branch can change its own copy of the workflow
  • check-gate then makes sure that ECCR_USERNAME and ECCR_PASSWORD are not repository or organization secrets. The job has no environment, so it sees only those shared secrets. If it sees a value, it fails and tells you to move the value to the environment. It reads the secrets only for this check, before it checks out any code
  • the workflow does not run the tests again; ci.yml runs on every push to every branch
  • check-gate runs on ubuntu-24.04. It checks out main (no persisted credentials) and loads ./.github/actions/check-ci-gate from that checkout
  • check-gate reads the head of the source branch and the latest push run of ci.yml for that commit in this repository. The run must be completed with the conclusion success. A newer failed or unfinished run takes precedence over an older successful run. A fork branch or a pull-request run never satisfies this check
  • check-gate also reports the latest Security run for the commit (push, pull request, or manual dispatch). This result is advisory and does not block publishing. Security runs on pushes to main and on pull requests to main. To scan another branch before you publish it, dispatch the Security workflow on that branch
  • if a check fails, check-gate writes the reason as a notice and the publish job is skipped. If an API request for CI fails, check-gate fails. If the advisory Security request fails, the summary shows unknown
  • the check-gate summary shows the requester, the source branch, the commit, the CI and Security results, and a link that compares the commit with main. The reviewer reads the summary and the compared changes before approving
  • the build-push-dev job belongs to the develop-publish environment. The environment holds the registry credentials. Required reviewers on that environment are the permission control: they decide, per run, whether the publish may start
  • build-push-dev uses the develop-publish concurrency group, so only one publish runs at a time
  • build-push-dev checks out main in the workspace root. All local actions (the gate recheck, the credential preparation, and the summary) come from that trusted checkout
  • build-push-dev then runs the same gate check again. If the branch head moved in the meantime, the job fails with a clear message and publishes nothing; dispatch again to publish the new head
  • uses the GitHub-hosted runner ubuntu-24.04
  • uses ./.github/actions/prepare-publishing to install GNU Make when needed, resolve credentials, and log in to Docker and Helm
  • uses the provided ECMWF container registry (ECCR) credentials when both values are set; otherwise, retrieves credentials from Vault and keeps each provided value in preference to its Vault value
  • validates and masks the resolved credentials, then passes action outputs to Docker and Helm without exporting credentials to the job environment
  • checks out the source commit in the source/ directory, and runs make publish-develop in that directory. The chart version is <VERSION>-develop, where VERSION is the VERSION file of the source branch
  • summarizes the requester, the source branch, the published commit, and the final job status

Trust model:

  • the CI result of a branch other than main shows only that the ci.yml of that branch passed. The branch can change its own ci.yml, so for such a branch the result is not a security control
  • the build step runs the Makefile and Dockerfiles of the source branch after the registry login. That code can read the registry credentials. The required-reviewer approval of the develop-publish environment is the control that makes this acceptable. Keep the reviewer list to platform maintainers, and approve only after you read the compared changes
  • no branch is special: any branch whose head has a green CI push run in this repository can feed the develop channel. A published run replaces the develop images and the <VERSION>-develop chart

Setting up the develop channel

  1. In repository Settings, create the develop-publish environment (Settings, Environments).
  2. Add required reviewers, and select Prevent self-review. Any user with write access can dispatch a run, but nothing is published until a different reviewer accepts the pending deployment.
  3. Set Deployment branches and tags to Selected branches and tags, and add only the main branch. A copy of the workflow on another branch then cannot use the environment.
  4. Add ECCR_USERNAME and ECCR_PASSWORD as environment secrets of develop-publish. Delete the repository and organization secrets with these names: every workflow on every branch can read a shared secret, and the workflow fails while one exists.

Permissions:

  • top-level contents: read
  • check-gate: actions: read and contents: read. It reads the branch head, the CI runs, and the Security runs through the API
  • build-push-dev: actions: read for the gate recheck, contents: read for checkout, and id-token: write for Vault authentication

Credential inputs:

  • ECCR_USERNAME
  • ECCR_PASSWORD

Set both values as develop-publish environment secrets. The credential action does not read repository variables. If either value is missing, it uses Vault with GitHub OpenID Connect (OIDC) authentication. Both resolved values must be set before registry login. The Vault endpoints are accessible only from the ECMWF internal network, so the GitHub-hosted runner cannot use them. With an environment, the OIDC subject claim is repo:ecmwf/ecmwf-sites:environment:develop-publish; bind a Vault role to that claim.

Gate troubleshooting

The shared gate action writes Starting the CI gate. before it loads the gate module. It then logs each API check: the branch head and the CI push runs. The Release workflow uses the same action for main.

A notice that starts with Publishing is blocked is not an action failure. It means that the required CI run has not passed for the branch head commit, or the commit is no longer the branch head. The gate returns ready: false, and publishing is skipped.

A module-load or API error fails the action and sets no ready output. The error identifies the operation and includes the HTTP status when available. For an HTTP 403 response from the workflow-runs API, check that the calling job has actions: read.

If the log has only the action inputs and no startup message, inspect the job annotations and runner logs. The gate code might not have started. Do not change the publishing conditions to bypass the failure. Merge changes to main before testing a new dispatch: GitHub runs the workflow file of the dispatched ref, and only the main copy is allowed to publish.

Fork pull request policy

The repository does not use pull_request_target.

Instead, ci.yml and security.yml start with a gate job that calls the reusable workflow external-pr-gate.yml. Every other job of those workflows needs the gate job, so no job runs repository code before the gate passes. The reusable workflow has no checkout, no secret, and no token permission. It has two jobs:

  1. label fails with an error annotation that names the approved-for-ci label when a PR comes from a fork and does not have that label. Every job that needs gate is then skipped.
  2. approve runs only for fork PRs. It uses the external-pull-request environment, so the protection rules of that environment decide when the run continues.

Notes:

  • security.yml starts a new run when the label is applied, because it listens for the labeled event
  • ci.yml uses the default pull-request event types, so re-run that workflow after you apply the label
  • Add the check External pull request gate / Check approved-for-ci label to the required status checks of the protected branches. A job that a failed gate job skipped is not a failure for branch protection.

Per-run approval

The label stays on the PR after a contributor pushes new commits, so it does not approve the new code. Two GitHub settings give a per-run approval:

  • In the external-pull-request environment (Settings, Environments), add required reviewers. The approve job then waits for a reviewer on each run of a fork PR. Without reviewers, the environment allows the run and only the label applies.
  • In Settings, Actions, General, set the approval for fork pull request workflows to Require approval for all external contributors. GitHub then asks for approval before it starts any workflow of a fork PR, and this is the only control that a PR cannot change. A fork PR can change the workflow files that it runs, so the label gate and the environment are a safeguard and not a security boundary.

This policy currently applies to:

  • ci.yml
  • all jobs in security.yml