Skip to content

Commit 0a0cb19

Browse files
committed
👷 Use uv in CI
1 parent 233009a commit 0a0cb19

5 files changed

Lines changed: 60 additions & 34 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
types:
88
- opened
99
- synchronize
10+
11+
env:
12+
UV_SYSTEM_PYTHON: 1
13+
1014
jobs:
1115
changes:
1216
runs-on: ubuntu-latest
@@ -52,17 +56,19 @@ jobs:
5256
uses: actions/setup-python@v5
5357
with:
5458
python-version: "3.11"
55-
- uses: actions/cache@v4
56-
id: cache
59+
- name: Setup uv
60+
uses: astral-sh/setup-uv@v3
5761
with:
58-
path: ${{ env.pythonLocation }}
59-
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-insiders.txt') }}-v02
62+
version: "0.4.15"
63+
enable-cache: true
64+
cache-dependency-glob: |
65+
requirements**.txt
66+
pyproject.toml
6067
- name: Install docs extras
61-
if: steps.cache.outputs.cache-hit != 'true'
62-
run: pip install -r requirements-docs.txt
68+
run: uv pip install -r requirements-docs.txt
6369
- name: Install Material for MkDocs Insiders
64-
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
65-
run: pip install -r requirements-docs-insiders.txt
70+
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
71+
run: uv pip install -r requirements-docs-insiders.txt
6672
env:
6773
TOKEN: ${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }}
6874
- uses: actions/cache@v4

.github/workflows/deploy-docs.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ jobs:
2525
uses: actions/setup-python@v5
2626
with:
2727
python-version: "3.11"
28-
- uses: actions/cache@v4
29-
id: cache
28+
- name: Setup uv
29+
uses: astral-sh/setup-uv@v3
3030
with:
31-
path: ${{ env.pythonLocation }}
32-
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
31+
version: "0.4.15"
32+
enable-cache: true
33+
cache-dependency-glob: |
34+
requirements**.txt
35+
pyproject.toml
3336
- name: Install GitHub Actions dependencies
34-
if: steps.cache.outputs.cache-hit != 'true'
35-
run: pip install -r requirements-github-actions.txt
37+
run: uv pip install -r requirements-github-actions.txt
3638
- name: Deploy Docs Status Pending
3739
run: python ./scripts/deploy_docs_status.py
3840
env:

.github/workflows/smokeshow.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ name: Smokeshow
22

33
on:
44
workflow_run:
5-
workflows: [Test]
6-
types: [completed]
5+
workflows:
6+
- Test
7+
types:
8+
- completed
79

810
permissions:
911
statuses: write
1012

13+
env:
14+
UV_SYSTEM_PYTHON: 1
15+
1116
jobs:
1217
smokeshow:
1318
if: ${{ github.event.workflow_run.conclusion == 'success' }}
@@ -21,16 +26,21 @@ jobs:
2126
- uses: actions/setup-python@v5
2227
with:
2328
python-version: '3.9'
24-
25-
- run: pip install smokeshow
26-
29+
- name: Setup uv
30+
uses: astral-sh/setup-uv@v3
31+
with:
32+
version: "0.4.15"
33+
enable-cache: true
34+
cache-dependency-glob: |
35+
requirements**.txt
36+
pyproject.toml
37+
- run: uv pip install -r requirements-github-actions.txt
2738
- uses: actions/download-artifact@v4
2839
with:
2940
name: coverage-html
3041
path: htmlcov
3142
github-token: ${{ secrets.GITHUB_TOKEN }}
3243
run-id: ${{ github.event.workflow_run.id }}
33-
3444
- run: smokeshow upload htmlcov
3545
env:
3646
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}

.github/workflows/test.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
# cron every week on monday
1313
- cron: "0 0 * * 1"
1414

15+
env:
16+
UV_SYSTEM_PYTHON: 1
17+
1518
jobs:
1619
test:
1720
strategy:
@@ -41,18 +44,16 @@ jobs:
4144
uses: actions/setup-python@v5
4245
with:
4346
python-version: ${{ matrix.python-version }}
44-
# Issue ref: https://github.com/actions/setup-python/issues/436
45-
# cache: "pip"
46-
# cache-dependency-path: pyproject.toml
47-
- uses: actions/cache@v4
48-
if: ${{ runner.os != 'macOS' }}
49-
id: cache
47+
- name: Setup uv
48+
uses: astral-sh/setup-uv@v3
5049
with:
51-
path: ${{ env.pythonLocation }}
52-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}
50+
version: "0.4.15"
51+
enable-cache: true
52+
cache-dependency-glob: |
53+
requirements**.txt
54+
pyproject.toml
5355
- name: Install Dependencies
54-
if: steps.cache.outputs.cache-hit != 'true'
55-
run: pip install -r requirements-tests.txt
56+
run: uv pip install -r requirements-tests.txt
5657
- name: Lint
5758
run: bash scripts/lint.sh
5859
- run: mkdir coverage
@@ -81,16 +82,22 @@ jobs:
8182
- uses: actions/setup-python@v5
8283
with:
8384
python-version: '3.8'
84-
# Issue ref: https://github.com/actions/setup-python/issues/436
85-
# cache: "pip"
86-
# cache-dependency-path: pyproject.toml
85+
- name: Setup uv
86+
uses: astral-sh/setup-uv@v3
87+
with:
88+
version: "0.4.15"
89+
enable-cache: true
90+
cache-dependency-glob: |
91+
requirements**.txt
92+
pyproject.toml
8793
- name: Get coverage files
8894
uses: actions/download-artifact@v4
8995
with:
9096
pattern: coverage-*
9197
path: coverage
9298
merge-multiple: true
93-
- run: pip install coverage[toml]
99+
- name: Install Dependencies
100+
run: uv pip install -r requirements-tests.txt
94101
- run: ls -la coverage
95102
- run: coverage combine coverage
96103
- run: coverage report

requirements-github-actions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ PyGithub>=2.3.0,<3.0.0
22
pydantic>=2.5.3,<3.0.0
33
pydantic-settings>=2.1.0,<3.0.0
44
httpx>=0.27.0,<0.28.0
5+
smokeshow

0 commit comments

Comments
 (0)