From cff8dfd17647f45d69237d1f2c074a7d15f90f18 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Wed, 11 Jun 2025 14:39:44 +0200 Subject: [PATCH 1/2] Use pre-commit on CI --- .github/workflows/shared.yml | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/shared.yml b/.github/workflows/shared.yml index e3fbe73bf7..8a5c736e6c 100644 --- a/.github/workflows/shared.yml +++ b/.github/workflows/shared.yml @@ -4,39 +4,24 @@ on: workflow_call: jobs: - format: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v3 + - uses: astral-sh/setup-uv@v5 with: enable-cache: true version: 0.7.2 - - name: Install the project - run: uv sync --frozen --all-extras --dev --python 3.12 - - - name: Run ruff format check - run: uv run --no-sync ruff check . - - typecheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + - name: Install dependencies + run: uv sync --frozen --python 3.10 - - name: Install uv - uses: astral-sh/setup-uv@v3 + - uses: pre-commit/action@v3.0.0 with: - enable-cache: true - version: 0.7.2 - - - name: Install the project - run: uv sync --frozen --all-extras --dev --python 3.12 - - - name: Run pyright - run: uv run --no-sync pyright + extra_args: --all-files --verbose + env: + SKIP: no-commit-to-branch test: runs-on: ${{ matrix.os }} From 642a35dd3481f9affe0d64bf3017bb58f3ec495e Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Wed, 11 Jun 2025 14:52:24 +0200 Subject: [PATCH 2/2] Add --all-extras --- .github/workflows/shared.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/shared.yml b/.github/workflows/shared.yml index 8a5c736e6c..b5e880affc 100644 --- a/.github/workflows/shared.yml +++ b/.github/workflows/shared.yml @@ -4,7 +4,7 @@ on: workflow_call: jobs: - lint: + pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -15,7 +15,7 @@ jobs: version: 0.7.2 - name: Install dependencies - run: uv sync --frozen --python 3.10 + run: uv sync --frozen --all-extras --python 3.10 - uses: pre-commit/action@v3.0.0 with: @@ -40,7 +40,7 @@ jobs: version: 0.7.2 - name: Install the project - run: uv sync --frozen --all-extras --dev --python ${{ matrix.python-version }} + run: uv sync --frozen --all-extras --python ${{ matrix.python-version }} - name: Run pytest run: uv run --no-sync pytest