Skip to content

Commit 81a5044

Browse files
committed
CI: Improve setup of and caching with uv
1 parent c63f75c commit 81a5044

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

.github/workflows/codeql.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
language: [ python ]
33+
python-version: ['3.11']
3334

3435
steps:
3536
- name: Checkout
@@ -38,15 +39,15 @@ jobs:
3839
- name: Set up Python
3940
uses: actions/setup-python@v5
4041
with:
41-
python-version: 3.11
42-
architecture: x64
43-
cache: 'pip'
44-
cache-dependency-path: |
45-
setup.py
42+
python-version: ${{ matrix.python-version }}
4643

47-
- name: Install uv
44+
- name: Set up uv
4845
uses: astral-sh/setup-uv@v5
4946
with:
47+
cache-dependency-glob: |
48+
setup.py
49+
cache-suffix: ${{ matrix.python-version }}
50+
enable-cache: true
5051
version: "latest"
5152

5253
- name: Initialize CodeQL

.github/workflows/nightly.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v4
28-
- name: Set up Python ${{ matrix.python-version }}
28+
29+
- name: Set up Python
2930
uses: actions/setup-python@v5
3031
with:
3132
python-version: ${{ matrix.python-version }}
32-
cache: 'pip'
33-
cache-dependency-path: 'setup.py'
3433

35-
- name: Install uv
34+
- name: Set up uv
3635
uses: astral-sh/setup-uv@v5
3736
with:
37+
cache-dependency-glob: |
38+
setup.py
39+
cache-suffix: ${{ matrix.python-version }}
40+
enable-cache: true
3841
version: "latest"
3942

4043
- name: Invoke tests

.github/workflows/release.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,28 @@ on: push
66
jobs:
77
pypi:
88
name: Build & publish package to pypi
9-
runs-on: ubuntu-latest
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: ['ubuntu-latest']
14+
python-version: ['3.11']
1015
if: startsWith(github.event.ref, 'refs/tags')
1116
steps:
1217
- uses: actions/checkout@v4
1318

1419
- name: Set up Python
1520
uses: actions/setup-python@v5
1621
with:
17-
python-version: '3.11'
18-
cache: 'pip'
19-
cache-dependency-path: 'setup.py'
22+
python-version: ${{ matrix.python-version }}
2023

21-
- name: Install uv
24+
- name: Set up uv
2225
uses: astral-sh/setup-uv@v5
2326
with:
27+
cache-dependency-glob: |
28+
setup.py
29+
cache-suffix: ${{ matrix.python-version }}
30+
enable-cache: true
2431
version: "latest"
2532

2633
- name: Build package

.github/workflows/tests.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,19 @@ jobs:
4040

4141
steps:
4242
- uses: actions/checkout@v4
43-
- name: Set up Python ${{ matrix.python-version }}
43+
44+
- name: Set up Python
4445
uses: actions/setup-python@v5
4546
with:
4647
python-version: ${{ matrix.python-version }}
47-
cache: 'pip'
48-
cache-dependency-path: setup.py
4948

50-
- name: Install uv
49+
- name: Set up uv
5150
uses: astral-sh/setup-uv@v5
5251
with:
52+
cache-dependency-glob: |
53+
setup.py
54+
cache-suffix: ${{ matrix.python-version }}
55+
enable-cache: true
5356
version: "latest"
5457

5558
- name: Invoke tests

0 commit comments

Comments
 (0)