Skip to content

Commit

Permalink
separate pre-commit from test job
Browse files Browse the repository at this point in the history
  • Loading branch information
hofaflo committed Nov 26, 2024
1 parent a7965a3 commit 130a855
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,26 @@ concurrency:


jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('pyproject.toml') }}
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Pre-commit
run: uv run --python=3.9 --with numpy==1.22.0 pre-commit run --all-files

test:
needs: pre-commit
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -35,17 +54,12 @@ jobs:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Pre-commit
run: |
uv run --with ${{ matrix.numpy }} pre-commit run --all-files
- name: Pytest
run: |
uv run --with ${{ matrix.numpy }} pytest -Werror --cov --cov-report term-missing --cov-fail-under=100
run: uv run --with ${{ matrix.numpy }} pytest -Werror --cov --cov-report term-missing --cov-fail-under=100

0 comments on commit 130a855

Please sign in to comment.