Skip to content

Commit 85c3a14

Browse files
committed
ci: test action with uv extra
1 parent 6878a1b commit 85c3a14

File tree

1 file changed

+72
-14
lines changed

1 file changed

+72
-14
lines changed

.github/workflows/test.yml

Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,29 @@ jobs:
4646
- name: PyLint checks
4747
run: pipx run --python "${{ steps.python.outputs.python-path }}" nox -s pylint -- --output-format=github
4848

49+
sample:
50+
name: Generate a sample project
51+
needs: lint
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v6
55+
- uses: actions/setup-python@v6
56+
name: Install Python
57+
with:
58+
python-version: "3.x"
59+
- uses: astral-sh/setup-uv@v7
60+
- name: Install dependencies
61+
run: uv sync --no-dev --group test
62+
- name: Generate a sample project
63+
run: uv run --no-sync -m test.test_projects test.test_0_basic.basic_project sample_proj
64+
- uses: actions/upload-artifact@v6
65+
with:
66+
name: sample_proj
67+
path: sample_proj
68+
4969
test:
5070
name: Test on ${{ matrix.os }} (${{ matrix.python_version }}) ${{ matrix.test_select }}
51-
needs: lint
71+
needs: sample
5272
runs-on: ${{ matrix.os }}
5373
strategy:
5474
fail-fast: false
@@ -120,8 +140,7 @@ jobs:
120140
sudo xcode-select --switch /Applications/Xcode_16.4.app
121141
122142
- name: Install dependencies
123-
run: |
124-
uv sync --no-dev --group test
143+
run: uv sync --no-dev --group test
125144

126145
- uses: joerick/pr-labels-action@v1.0.9
127146

@@ -144,9 +163,11 @@ jobs:
144163
fi
145164
echo "CIBW_ENABLE=${CIBW_ENABLE}" >> $GITHUB_ENV
146165
147-
- name: Generate a sample project
148-
run: |
149-
uv run --no-sync -m test.test_projects test.test_0_basic.basic_project sample_proj
166+
- name: Download a sample project
167+
uses: actions/download-artifact@v5
168+
with:
169+
name: sample_proj
170+
path: sample_proj
150171

151172
- name: Run a sample build (GitHub Action)
152173
uses: ./
@@ -209,8 +230,7 @@ jobs:
209230
- name: Test cibuildwheel
210231
env:
211232
CIBW_TEST_RUNTIME: ${{ matrix.test_runtime }}
212-
run: |
213-
uv run --no-sync bin/run_tests.py --test-select=${{ matrix.test_select || 'native' }} ${{ (runner.os == 'Linux' && runner.arch == 'X64') && '--run-podman' || '' }}
233+
run: uv run --no-sync bin/run_tests.py --test-select=${{ matrix.test_select || 'native' }} ${{ (runner.os == 'Linux' && runner.arch == 'X64') && '--run-podman' || '' }}
214234

215235
emulated-archs:
216236
name: Get qemu emulated architectures
@@ -258,7 +278,7 @@ jobs:
258278

259279
test-pyodide:
260280
name: Test pyodide
261-
needs: lint
281+
needs: sample
262282
runs-on: ubuntu-24.04
263283
timeout-minutes: 180
264284
steps:
@@ -272,9 +292,11 @@ jobs:
272292
- name: Install dependencies
273293
run: uv sync --no-dev --group test
274294

275-
- name: Generate a sample project
276-
run: |
277-
uv run --no-sync -m test.test_projects test.test_0_basic.basic_project sample_proj
295+
- name: Download a sample project
296+
uses: actions/download-artifact@v5
297+
with:
298+
name: sample_proj
299+
path: sample_proj
278300

279301
- name: Run a sample build (GitHub Action)
280302
uses: ./
@@ -285,7 +307,43 @@ jobs:
285307
CIBW_PLATFORM: pyodide
286308

287309
- name: Run tests with 'CIBW_PLATFORM' set to 'pyodide'
288-
run: |
289-
uv run --no-sync ./bin/run_tests.py
310+
run: uv run --no-sync ./bin/run_tests.py
290311
env:
291312
CIBW_PLATFORM: pyodide
313+
314+
test-uv-extras:
315+
name: Test uv extra on ${{ matrix.os }} ${{ matrix.test_select }}
316+
needs: sample
317+
runs-on: ${{ matrix.os }}
318+
strategy:
319+
fail-fast: false
320+
matrix:
321+
include:
322+
- os: ubuntu-latest
323+
test_select: android
324+
- os: windows-latest
325+
- os: windows-11-arm
326+
- os: macos-15-intel
327+
- os: macos-15
328+
- os: macos-15-intel
329+
test_select: android
330+
- os: macos-15
331+
test_select: android
332+
steps:
333+
- uses: actions/checkout@v6
334+
- name: Download a sample project
335+
uses: actions/download-artifact@v5
336+
with:
337+
name: sample_proj
338+
path: sample_proj
339+
- name: Run a sample build (GitHub Action)
340+
uses: ./
341+
with:
342+
extras: uv
343+
package-dir: sample_proj
344+
output-dir: wheelhouse
345+
env:
346+
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
347+
CIBW_BUILD: cp314-*
348+
CIBW_BUILD_FRONTEND: 'build[uv]'
349+
CIBW_PLATFORM: ${{ matrix.test_select }}

0 commit comments

Comments
 (0)