Skip to content

Commit a599261

Browse files
authored
👷 Use uv for CI (#242)
1 parent 8c8457a commit a599261

File tree

5 files changed

+62
-36
lines changed

5 files changed

+62
-36
lines changed

.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') }}-v01
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.ASYNCER_MKDOCS_MATERIAL_INSIDERS }}
6874
- uses: actions/cache@v4

.github/workflows/deploy-docs.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ permissions:
1212
pull-requests: write
1313
statuses: write
1414

15+
env:
16+
UV_SYSTEM_PYTHON: 1
17+
1518
jobs:
1619
deploy-docs:
1720
runs-on: ubuntu-latest
@@ -25,14 +28,16 @@ jobs:
2528
uses: actions/setup-python@v5
2629
with:
2730
python-version: "3.11"
28-
- uses: actions/cache@v4
29-
id: cache
31+
- name: Setup uv
32+
uses: astral-sh/setup-uv@v3
3033
with:
31-
path: ${{ env.pythonLocation }}
32-
key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01
34+
version: "0.4.15"
35+
enable-cache: true
36+
cache-dependency-glob: |
37+
requirements**.txt
38+
pyproject.toml
3339
- name: Install GitHub Actions dependencies
34-
if: steps.cache.outputs.cache-hit != 'true'
35-
run: pip install -r requirements-github-actions.txt
40+
run: uv pip install -r requirements-github-actions.txt
3641
- name: Deploy Docs Status Pending
3742
run: python ./scripts/deploy_docs_status.py
3843
env:

.github/workflows/smokeshow.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,32 @@ 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
- uses: actions/setup-python@v5
1820
with:
1921
python-version: '3.9'
20-
21-
- run: pip install smokeshow
22-
22+
- name: Setup uv
23+
uses: astral-sh/setup-uv@v3
24+
with:
25+
version: "0.4.15"
26+
enable-cache: true
27+
cache-dependency-glob: |
28+
requirements**.txt
29+
pyproject.toml
30+
- run: uv pip install -r requirements-github-actions.txt
2331
- uses: actions/download-artifact@v4
2432
with:
2533
name: coverage-html
2634
path: htmlcov
2735
github-token: ${{ secrets.GITHUB_TOKEN }}
2836
run-id: ${{ github.event.workflow_run.id }}
29-
3037
- run: smokeshow upload htmlcov
3138
env:
3239
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}

.github/workflows/test.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
# cron every week on monday
1919
- cron: "0 0 * * 1"
2020

21+
env:
22+
UV_SYSTEM_PYTHON: 1
23+
2124
jobs:
2225
test:
2326
runs-on: ubuntu-latest
@@ -33,33 +36,34 @@ jobs:
3336
- anyio-v3
3437
- anyio-v4
3538
fail-fast: false
36-
3739
steps:
3840
- uses: actions/checkout@v4
3941
- name: Set up Python
4042
uses: actions/setup-python@v5
4143
with:
4244
python-version: ${{ matrix.python-version }}
45+
- name: Setup uv
46+
uses: astral-sh/setup-uv@v3
47+
with:
48+
version: "0.4.15"
49+
enable-cache: true
50+
cache-dependency-glob: |
51+
requirements**.txt
52+
pyproject.toml
4353
# Allow debugging with tmate
4454
- name: Setup tmate session
4555
uses: mxschmitt/action-tmate@v3
4656
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
4757
with:
4858
limit-access-to-actor: true
49-
- uses: actions/cache@v4
50-
id: cache
51-
with:
52-
path: ${{ env.pythonLocation }}
53-
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}
5459
- name: Install Dependencies
55-
if: steps.cache.outputs.cache-hit != 'true'
56-
run: pip install -r requirements-tests.txt
60+
run: uv pip install -r requirements-tests.txt
5761
- name: Install AnyIO v3
5862
if: matrix.anyio-version == 'anyio-v3'
59-
run: pip install --upgrade "anyio>=3.4.0,<4.0"
63+
run: uv pip install --upgrade "anyio>=3.4.0,<4.0"
6064
- name: Install AnyIO v4
6165
if: matrix.anyio-version == 'anyio-v4'
62-
run: pip install --upgrade "anyio>=4.0.0,<5.0"
66+
run: uv pip install --upgrade "anyio>=4.0.0,<5.0"
6367
- name: Lint
6468
if: matrix.anyio-version == 'anyio-v4'
6569
run: bash scripts/lint.sh
@@ -80,28 +84,31 @@ jobs:
8084
needs:
8185
- test
8286
runs-on: ubuntu-latest
83-
8487
steps:
8588
- uses: actions/checkout@v4
86-
8789
- uses: actions/setup-python@v5
8890
with:
8991
python-version: '3.8'
90-
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
91100
- name: Get coverage files
92101
uses: actions/download-artifact@v4
93102
with:
94103
pattern: coverage-*
95104
path: coverage
96105
merge-multiple: true
97-
98-
- run: pip install coverage[toml]
99-
106+
- name: Install Dependencies
107+
run: uv pip install -r requirements-tests.txt
100108
- run: ls -la coverage
101109
- run: coverage combine coverage
102110
- run: coverage report
103111
- run: coverage html --title "Coverage for ${{ github.sha }}"
104-
105112
- name: Store coverage HTML
106113
uses: actions/upload-artifact@v4
107114
with:

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)