67 lines
1.6 KiB
YAML
67 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
checks:
|
|
name: ${{ matrix.task }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- task: format
|
|
do_sync: true
|
|
command: uv run --no-sync ruff format --check --diff
|
|
sync_args: --no-install-project
|
|
- task: ruff
|
|
do_sync: true
|
|
command: uv run --no-sync ruff check . --output-format=github
|
|
sync_args: --no-install-project
|
|
- task: ty
|
|
do_sync: true
|
|
command: uv run --no-sync ty check .
|
|
sync_args: --no-install-project
|
|
- task: pytest
|
|
do_sync: true
|
|
command: uv run --no-sync pytest
|
|
sync_args: ""
|
|
- task: build
|
|
do_sync: false
|
|
command: uv build
|
|
sync_args: ""
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
python-version: "3.14"
|
|
enable-cache: true
|
|
|
|
- name: Install dependencies
|
|
if: matrix.do_sync
|
|
run: uv sync --frozen ${{ matrix.sync_args }}
|
|
|
|
- name: Run check
|
|
run: ${{ matrix.command }}
|
|
|
|
- name: Add coverage to summary
|
|
if: ${{ always() && matrix.task == 'pytest' }}
|
|
run: |
|
|
{
|
|
echo "## Coverage"
|
|
echo ""
|
|
uv run --no-sync python -m coverage report || true
|
|
} >> "$GITHUB_STEP_SUMMARY"
|