Skip to content

Commit 5336864

Browse files
committed
Adjust pytest action
1 parent cabdffb commit 5336864

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

.github/workflows/pytest.yml

+23-14
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,34 @@ jobs:
2323
- ubuntu-latest
2424
- windows-latest
2525
- macos-latest
26+
env:
27+
UV_CACHE_DIR: /tmp/.uv-cache
28+
RUST_BACKTRACE: 1
2629

2730
steps:
2831
- uses: actions/checkout@v4
2932

30-
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v5
32-
with:
33-
python-version: ${{ matrix.python-version }}
33+
- name: Set up uv
34+
if: ${{ matrix.os == 'ubuntu-22.04' || matrix.os == 'macos-latest' }}
35+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
36+
37+
- name: Set up uv
38+
if: ${{ matrix.os == 'windows-latest' }}
39+
run: irm https://astral.sh/uv/install.ps1 | iex
40+
shell: powershell
3441

35-
- name: Install Rust
36-
uses: actions-rs/toolchain@v1
42+
- name: Cache folder for uv
43+
uses: actions/cache@v4
3744
with:
38-
toolchain: stable
39-
default: true
45+
path: /tmp/.uv-cache
46+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
47+
restore-keys: |
48+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
49+
uv-${{ runner.os }}
4050
41-
- name: Log active toolchain
42-
run: rustup show
51+
- name: Install the project
52+
working-directory: python
53+
run: uv sync --all-extras --dev --python ${{ matrix.python-version }}
4354

4455
- name: Build the Python binding
4556
working-directory: python
@@ -50,14 +61,12 @@ jobs:
5061
- name: Run linter and formatter
5162
working-directory: python
5263
run: |
53-
uv run ruff check
54-
uv run ruff format --check
64+
uv run ruff check
65+
uv run ruff format --check
5566
5667
- name: Test Python
5768
working-directory: python
5869
run: |
5970
uv run pytest
6071
shell: bash
6172

62-
env:
63-
RUST_BACKTRACE: 1

0 commit comments

Comments
 (0)