Skip to content

Commit 4b3fa6e

Browse files
authored
👷 Use uv in CI (#105)
1 parent aa61ef8 commit 4b3fa6e

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

.github/workflows/smokeshow.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ on:
88
permissions:
99
statuses: write
1010

11+
env:
12+
UV_SYSTEM_PYTHON: 1
13+
1114
jobs:
1215
smokeshow:
1316
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1417
runs-on: ubuntu-latest
15-
1618
steps:
1719
- name: Dump GitHub context
1820
env:
@@ -21,16 +23,21 @@ jobs:
2123
- uses: actions/setup-python@v5
2224
with:
2325
python-version: '3.9'
24-
25-
- run: pip install smokeshow
26-
26+
- name: Setup uv
27+
uses: astral-sh/setup-uv@v3
28+
with:
29+
version: "0.4.15"
30+
enable-cache: true
31+
cache-dependency-glob: |
32+
requirements**.txt
33+
pyproject.toml
34+
- run: uv pip install -r requirements-github-actions.txt
2735
- uses: actions/download-artifact@v4
2836
with:
2937
name: coverage-html
3038
path: htmlcov
3139
github-token: ${{ secrets.GITHUB_TOKEN }}
3240
run-id: ${{ github.event.workflow_run.id }}
33-
3441
- run: smokeshow upload htmlcov
3542
env:
3643
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}

.github/workflows/test.yml

+20-13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
required: false
2222
default: 'false'
2323

24+
env:
25+
UV_SYSTEM_PYTHON: 1
26+
2427
jobs:
2528
test:
2629
runs-on: ubuntu-latest
@@ -43,23 +46,22 @@ jobs:
4346
uses: actions/setup-python@v5
4447
with:
4548
python-version: ${{ matrix.python-version }}
46-
# Issue ref: https://github.com/actions/setup-python/issues/436
47-
# cache: "pip"
48-
# cache-dependency-path: pyproject.toml
49-
- uses: actions/cache@v4
50-
id: cache
49+
- name: Setup uv
50+
uses: astral-sh/setup-uv@v3
5151
with:
52-
path: ${{ env.pythonLocation }}
53-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}
52+
version: "0.4.15"
53+
enable-cache: true
54+
cache-dependency-glob: |
55+
requirements**.txt
56+
pyproject.toml
5457
# Allow debugging with tmate
5558
- name: Setup tmate session
5659
uses: mxschmitt/action-tmate@v3
5760
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
5861
with:
5962
limit-access-to-actor: true
6063
- name: Install Dependencies
61-
if: steps.cache.outputs.cache-hit != 'true'
62-
run: pip install -r requirements-tests.txt
64+
run: uv pip install -r requirements-tests.txt
6365
- name: Lint
6466
run: bash scripts/lint.sh
6567
- run: mkdir coverage
@@ -87,16 +89,21 @@ jobs:
8789
- uses: actions/setup-python@v5
8890
with:
8991
python-version: '3.8'
90-
# Issue ref: https://github.com/actions/setup-python/issues/436
91-
# cache: "pip"
92-
# cache-dependency-path: pyproject.toml
92+
- name: Setup uv
93+
uses: astral-sh/setup-uv@v3
94+
with:
95+
version: "0.4.15"
96+
enable-cache: true
97+
cache-dependency-glob: |
98+
requirements**.txt
99+
pyproject.toml
93100
- name: Get coverage files
94101
uses: actions/download-artifact@v4
95102
with:
96103
pattern: coverage-*
97104
path: coverage
98105
merge-multiple: true
99-
- run: pip install coverage[toml]
106+
- run: uv pip install -r requirements-tests.txt
100107
- run: ls -la coverage
101108
- run: coverage combine coverage
102109
- run: coverage report

requirements-github-actions.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
smokeshow

0 commit comments

Comments
 (0)