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.
What fails, and what only shows
Section titled “What fails, and what only shows”- 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.
Set it up
Section titled “Set it up”In a terminal, in your repository, run one of:
eidos ci --write github # writes .github/workflows/eidos-check.ymleidos ci --write gitlab # adds an eidos-check job to .gitlab-ci.ymleidos ci # prints both and writes nothingCommit the file it writes. That is all. The job:
- installs the
eidoscommand, 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.
GitHub
Section titled “GitHub”eidos ci --write github writes this file:
name: Eidos checkon: pull_request: paths: - "Blueprints/**"permissions: contents: readjobs: 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 githubEach finding shows as a note on the pull request’s changed files, and in the run’s summary.
GitLab
Section titled “GitLab”eidos ci --write gitlab adds this job, between the lines # eidos:ci:start and # eidos:ci:end:
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.jsonThe 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.
Running the check yourself
Section titled “Running the check yourself”The same check runs anywhere with eidos check. For another CI host, these print the findings in each host’s format:
eidos check --format githubeidos check --format codequality > gl-code-quality-report.jsonBoth 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.