How to use ty in CI
by Tim Hopper
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 githubThis 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 gitlabOutput formats
ty supports four output formats, selected with --output-format:
| Format | Use case |
|---|---|
full (default) | Local development. Multi-line diagnostics with code context. |
concise | Log parsing and scripting. One line per error. |
github | GitHub Actions annotations. |
gitlab | GitLab CI annotations. |
ty check --output-format concisePinning 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/Also Mentioned In
Get Python tooling updates
Subscribe to the newsletterLast updated on