# GitHub checks

> Lint, golden tests and a cost estimate on every pull request, with emo check in your own CI; the GitHub App, which adds a preview, is planned.

Emolysis checks pull requests on GitHub, so every change to a pipeline is linted, tested and priced before it is merged and deployed. The checks run with `emo check`: a reusable GitHub Actions workflow, in preview, runs it in your own CI and needs the `emo` command line, which is not released yet. The GitHub App, which runs them without a workflow, is planned.

## The four checks

| Check        | What it reports                                                           |
| ------------ | ------------------------------------------------------------------------- |
| Lint         | SQL and Python checked against your platform's lint rules                 |
| Golden tests | Each pipeline's golden tests, run on DuckDB with the fixtures in `tests/` |
| Cost         | An estimate of what the change costs to run on your target platform       |
| Preview      | A link to a preview dashboard built from the change, for reviewers        |

Each check reports pass or fail with details: the lint rule and line, the failing test case and the differing rows, the cost drivers. Make the checks required in your branch rules and green checks become your deploy gate.

## How a change flows

1. You change a pipeline and open the pull request.
2. The checks run on the pull request: lint, golden tests, cost and preview.
3. Reviewers read the diff, the check results and the preview dashboard.
4. When every required check is green and the review is done, you merge.
5. You deploy from the merged commit. See [Deploying](https://emolysis.com/docs/deploying).

The golden tests in the checks are the same tests that run on your machine. A change that passes locally is expected to pass here, and a failure here can be reproduced locally with the same fixtures. See [Golden tests on DuckDB](https://emolysis.com/docs/golden-tests).

## Installing the GitHub App (planned)

Install the app on your GitHub organization or account and choose the repositories it can see. It asks for the fewest permissions its checks need:

- Read access to repository contents and metadata.
- Write access to checks and pull requests, to report results and comment.

It never asks for write access to your code.

## The reusable workflow

Without an app, a reusable GitHub Actions workflow, in preview, runs `emo check` inside your own CI, on your own runners; it needs the emo command line, which is not released yet. Referenced from a workflow in your repository, its results appear as checks on the pull request.

## Opening pull requests from Emolysis

`emo pr` and `emo sync` are planned: one opens a pull request for the current changes, the other commits and pushes without one, both with your own Git credentials.

## Fixtures are code

The golden tests in CI use the fixtures committed in `tests/`. Keep them synthetic: anything in the repository is visible to everyone with access to it and to the CI that runs the checks. See [Projects and emolysis.yml](https://emolysis.com/docs/projects).

## What leaves your machine

With the GitHub App (planned) installed, the app reads the contents of the repositories you choose to run its checks, and writes check results and comments on their pull requests. See [Data handling](https://emolysis.com/docs/data-handling).

---

Page: https://emolysis.com/docs/github-checks. Emolysis is a product of Bandpey GmbH, Munich, Germany. It is in private development, and nothing is released yet.
