Skip to content

Commit a5ef6ad

Browse files
committed
run precheck in CI
1 parent e16dc8e commit a5ef6ad

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,38 @@ permissions:
1111
contents: read
1212

1313
jobs:
14+
precheck:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.12'
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v3
27+
with:
28+
enable-cache: true
29+
cache-dependency-glob: "uv.lock"
30+
31+
- name: Setup venv and install pip dependencies
32+
run: |
33+
uv venv --python "3.12" \
34+
&& uv sync --all-extras \
35+
&& uv pip install pip \
36+
&& echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH" \
37+
&& if [ -d /nix/var/nix/profiles/default/bin ]; then echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"; fi
38+
39+
- name: Run pre-commit checks
40+
run: |
41+
source .venv/bin/activate \
42+
&& prek run --all-files
43+
1444
build:
45+
needs: precheck
1546
runs-on: ${{ matrix.os }}
1647
strategy:
1748
fail-fast: true

0 commit comments

Comments
 (0)