Skip to content

Commit 87e412e

Browse files
committed
use separate job to check formatting instead
1 parent b0932cc commit 87e412e

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

.github/workflows/CI.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ permissions:
2626
contents: read
2727

2828
jobs:
29+
format-check:
30+
name: Check Python formatting
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: 3.11
37+
- name: Install Ruff
38+
run: |
39+
pip install ruff
40+
- name: Check Python formatting
41+
run: |
42+
ruff format --check .
43+
2944
test:
3045
name: Run test
3146
uses: ./.github/workflows/_test.yml

.github/workflows/_test.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19+
- run: rustup toolchain install stable --profile minimal
20+
- name: Rust Cache
21+
uses: Swatinem/rust-cache@v2
22+
with:
23+
key: ${{ runner.os }}-rust-${{ matrix.python-version }}
24+
- name: Rust build
25+
run: cargo build --verbose
26+
- name: Rust tests
27+
run: cargo test --verbose
28+
1929
- uses: actions/setup-python@v5
2030
with:
2131
python-version: ${{ matrix.python-version }}
@@ -32,22 +42,7 @@ jobs:
3242
- name: Install Python toolchains
3343
run: |
3444
source .venv/bin/activate
35-
pip install maturin pytest mypy ruff
36-
- name: Check Python formatting
37-
run: |
38-
source .venv/bin/activate
39-
python -m ruff format --check .
40-
41-
- run: rustup toolchain install stable --profile minimal
42-
- name: Rust Cache
43-
uses: Swatinem/rust-cache@v2
44-
with:
45-
key: ${{ runner.os }}-rust-${{ matrix.python-version }}
46-
- name: Rust build
47-
run: cargo build --verbose
48-
- name: Rust tests
49-
run: cargo test --verbose
50-
45+
pip install maturin pytest mypy
5146
- name: Python build
5247
run: |
5348
source .venv/bin/activate

0 commit comments

Comments
 (0)