@@ -23,23 +23,34 @@ jobs:
23
23
- ubuntu-latest
24
24
- windows-latest
25
25
- macos-latest
26
+ env :
27
+ UV_CACHE_DIR : /tmp/.uv-cache
28
+ RUST_BACKTRACE : 1
26
29
27
30
steps :
28
31
- uses : actions/checkout@v4
29
32
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
34
41
35
- - name : Install Rust
36
- uses : actions-rs/toolchain@v1
42
+ - name : Cache folder for uv
43
+ uses : actions/cache@v4
37
44
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 }}
40
50
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 }}
43
54
44
55
- name : Build the Python binding
45
56
working-directory : python
@@ -50,14 +61,12 @@ jobs:
50
61
- name : Run linter and formatter
51
62
working-directory : python
52
63
run : |
53
- uv run ruff check
54
- uv run ruff format --check
64
+ uv run ruff check
65
+ uv run ruff format --check
55
66
56
67
- name : Test Python
57
68
working-directory : python
58
69
run : |
59
70
uv run pytest
60
71
shell : bash
61
72
62
- env :
63
- RUST_BACKTRACE : 1
0 commit comments