Skip to content

Checking in CI

This page is for whoever looks after your team’s repository on GitHub or GitLab. If your project lives in git, one command sets up a check that runs on every merge request (a pull request on GitHub). It catches the mistakes that are wrong whatever anyone meant, before they reach the main branch: a broken link, a page with a missing or duplicate id (two branches can pick the same one), a variant the collection does not have, properties that cannot be read.

  • An error fails the check. It needs fixing before the merge.
  • A warning never fails it, unless the project is strict. A missing section or property is often on purpose, so it shows on the merge request beside the file it names, for the reviewer to weigh.
  • The project decides, not the pipeline. If the project’s owners made warnings fail (eidos setup --strict on, or Framework Settings › Rules in the app), they fail in CI as they do on a laptop.

In a terminal, in your repository, run one of:

Terminal window
eidos ci --write github # writes .github/workflows/eidos-check.yml
eidos ci --write gitlab # adds an eidos-check job to .gitlab-ci.yml
eidos ci # prints both and writes nothing

Commit the file it writes. That is all. The job:

  • installs the eidos command, at the version your project is pinned to (eidos version pin), or else the version that wrote the job;
  • runs only when a merge request changes a file in the project’s folder, so a change to code alone starts nothing;
  • works when the project sits in a sub-folder of the repository, such as docs/Blueprints.

Run the command again to refresh the job, for example after you update eidos without a pin. It replaces what it wrote before and leaves the rest of the file as it was. A file or job of your own with the same name is left alone, and the command says so.

eidos ci --write github writes this file:

.github/workflows/eidos-check.yml
name: Eidos check
on:
pull_request:
paths:
- "Blueprints/**"
permissions:
contents: read
jobs:
eidos-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsSL https://eidosmd.com/install -o /tmp/eidos-install && EIDOS_VERSION=0.17.1 sh /tmp/eidos-install
- run: eidos check --root Blueprints --format github

Each finding shows as a note on the pull request’s changed files, and in the run’s summary.

eidos ci --write gitlab adds this job, between the lines # eidos:ci:start and # eidos:ci:end:

.gitlab-ci.yml
eidos-check:
image: buildpack-deps:bookworm
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- "Blueprints/**/*"
script:
- curl -fsSL https://eidosmd.com/install -o /tmp/eidos-install && EIDOS_VERSION=0.17.1 EIDOS_INSTALL_DIR=/usr/local/bin sh /tmp/eidos-install
- eidos check --root Blueprints --format codequality > gl-code-quality-report.json
artifacts:
when: always
reports:
codequality: gl-code-quality-report.json

The findings show in the merge request’s Code Quality report, which says what the merge request introduced and what it fixed. An error is major, a warning minor.

The same check runs anywhere with eidos check. For another CI host, these print the findings in each host’s format:

Terminal window
eidos check --format github
eidos check --format codequality > gl-code-quality-report.json

Both end with the same exit code as eidos check: 0 with no errors, 1 with an error (or a warning, on a strict project), 2 when the check could not run.

eidos check → · eidos ci →