Skip to content

How to use ty in CI

ty can run in CI with no installation step beyond uv. Because ty is a single binary with no runtime dependencies, it adds minimal overhead to your pipeline.

GitHub Actions

The simplest approach uses uvx to run ty without adding it as a project dependency:

- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
- run: uvx ty check src/

To get inline annotations on pull requests, use the github output format:

- run: uvx ty check src/ --output-format github

This produces GitHub-native annotations that appear directly on changed lines in the pull request diff.

GitLab CI

GitLab has a corresponding annotation format:

type-check:
  script:
    - uvx ty check src/ --output-format gitlab

Output formats

ty supports four output formats, selected with --output-format:

FormatUse case
full (default)Local development. Multi-line diagnostics with code context.
conciseLog parsing and scripting. One line per error.
githubGitHub Actions annotations.
gitlabGitLab CI annotations.
ty check --output-format concise

Pinning a ty version

To ensure consistent results across runs, pin the ty version:

- run: uvx ty@0.1 check src/

Running alongside Ruff

If you already use Ruff in CI, add ty as a separate step:

- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
- run: uvx ruff check .
- run: uvx ruff format --check .
- run: uvx ty check src/

Get Python tooling updates

Subscribe to the newsletter
Last updated on

Please submit corrections and feedback...