# CI setup

Report what each pull request changed in the architecture, then choose what should fail.

> Web page: https://enola.tech/docs/ci
> All pages: https://enola.tech/llms.txt

## Report on every pull request

[enola-action](https://github.com/enola-labs/enola-action) compares each pull request with its base commit. It runs on the GitHub runner, uploads no source, and needs no stored baseline.

.github/workflows/architecture.yml:

```yaml
name: Architecture
on:
  pull_request:
  merge_group:

permissions:
  contents: read

jobs:
  enola:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0
      - uses: enola-labs/enola-action@v2
```

With no inputs it reports and never fails the job. You get:

- a job summary of what the pull request changed in the architecture
- a warning on each line that introduced a finding, in **Files changed**
- a **No policy set** notice, so a green job is not mistaken for a verdict

Findings the repository already had stay out. Keep `fetch-depth: 0`, so that the base commit is available.

## Choose what fails

`fail-on` names the [explainers](https://enola.tech/docs/explainers.md) whose new findings fail the job:

Fail on declared layers and cycles:

```yaml
- uses: enola-labs/enola-action@v2
  with:
    fail-on: layers,cycles
```

`min-confidence` is how sure Enola must be. The default, `1.00`, means proven findings only, which five explainers can produce: `cycles`, `intent`, `constraints`, `final-inheritance`, and `layers` once you [declare a layer order](https://enola.tech/docs/intent.md). Any other explainer also needs a lower floor:

Include inferred findings:

```yaml
- uses: enola-labs/enola-action@v2
  with:
    fail-on: layers,hotspots
    min-confidence: "0.8"
```

`warn-only: "true"` keeps a policy but turns its failures into warnings, for example while a team gets used to it.

## Comments, reviewers and scope

| Input | What it does |
| --- | --- |
| `pr-comment` | Posts the report as one comment, edited on every push. Needs `pull-requests: write`. |
| `reviewers` | Names the owner of each module the change touched, and suggests a reviewer. Never fails the job. |
| `target`, `max-spillover` | Fails when a change reaches more packages than you allow outside its stated target. |
| `sarif` | Also writes the findings as SARIF, for code scanning. |
| `version` | Pins an Enola release instead of the latest. |

Every input is in the [action's README](https://github.com/enola-labs/enola-action#inputs). Its docs walk through [what lands on a pull request](https://github.com/enola-labs/enola-action/blob/main/docs/PULL-REQUEST.md) and [what fails a job](https://github.com/enola-labs/enola-action/blob/main/docs/POLICY.md).

## Use the CLI anywhere

Install Enola, fetch the target branch, and compare with where this branch left it. Nothing is pinned, and nothing is written to the checkout:

Any CI system:

```shell
enola check --base origin/main --fail-on=layers,cycles
```

Use a checkout with enough history to hold the merge-base. Exit code `0` passes, `1` is a policy failure, `2` means the check could not run, and `3` means the two sides cannot be compared. `--warn-only` reports without failing on findings.

## Publish the evidence

CI-native formats:

```shell
enola check --base origin/main --format=annotations --host=github
enola check --base origin/main --format=annotations --host=buildkite
enola check --base origin/main --format=sarif > enola.sarif
```

Annotations are native messages for GitHub Actions or Buildkite, SARIF works with code-scanning systems, and `--json` is for your own scripts. Use the exit code as the verdict.

## Keep both sides comparable

- `--base` and the action build both sides with one Enola version and configuration.
- With a pinned baseline, use the same Enola version, ignore configuration and repository identity for both.
- Pin an Enola release if a new one must not change your results.
- Keep the receipt with the job output.
