ci: test action with uv extra (#2712)
* ci: test action with `uv` extra * fix: uv extra for Android on Linux
This commit is contained in:
+72
-14
@@ -46,9 +46,29 @@ jobs:
|
|||||||
- name: PyLint checks
|
- name: PyLint checks
|
||||||
run: pipx run --python "${{ steps.python.outputs.python-path }}" nox -s pylint -- --output-format=github
|
run: pipx run --python "${{ steps.python.outputs.python-path }}" nox -s pylint -- --output-format=github
|
||||||
|
|
||||||
|
sample:
|
||||||
|
name: Generate a sample project
|
||||||
|
needs: lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-python@v6
|
||||||
|
name: Install Python
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
- uses: astral-sh/setup-uv@v7
|
||||||
|
- name: Install dependencies
|
||||||
|
run: uv sync --no-dev --group test
|
||||||
|
- name: Generate a sample project
|
||||||
|
run: uv run --no-sync -m test.test_projects test.test_0_basic.basic_project sample_proj
|
||||||
|
- uses: actions/upload-artifact@v6
|
||||||
|
with:
|
||||||
|
name: sample_proj
|
||||||
|
path: sample_proj
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test on ${{ matrix.os }} (${{ matrix.python_version }}) ${{ matrix.test_select }}
|
name: Test on ${{ matrix.os }} (${{ matrix.python_version }}) ${{ matrix.test_select }}
|
||||||
needs: lint
|
needs: sample
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -120,8 +140,7 @@ jobs:
|
|||||||
sudo xcode-select --switch /Applications/Xcode_16.4.app
|
sudo xcode-select --switch /Applications/Xcode_16.4.app
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: uv sync --no-dev --group test
|
||||||
uv sync --no-dev --group test
|
|
||||||
|
|
||||||
- uses: joerick/pr-labels-action@v1.0.9
|
- uses: joerick/pr-labels-action@v1.0.9
|
||||||
|
|
||||||
@@ -144,9 +163,11 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "CIBW_ENABLE=${CIBW_ENABLE}" >> $GITHUB_ENV
|
echo "CIBW_ENABLE=${CIBW_ENABLE}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Generate a sample project
|
- name: Download a sample project
|
||||||
run: |
|
uses: actions/download-artifact@v5
|
||||||
uv run --no-sync -m test.test_projects test.test_0_basic.basic_project sample_proj
|
with:
|
||||||
|
name: sample_proj
|
||||||
|
path: sample_proj
|
||||||
|
|
||||||
- name: Run a sample build (GitHub Action)
|
- name: Run a sample build (GitHub Action)
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -209,8 +230,7 @@ jobs:
|
|||||||
- name: Test cibuildwheel
|
- name: Test cibuildwheel
|
||||||
env:
|
env:
|
||||||
CIBW_TEST_RUNTIME: ${{ matrix.test_runtime }}
|
CIBW_TEST_RUNTIME: ${{ matrix.test_runtime }}
|
||||||
run: |
|
run: uv run --no-sync bin/run_tests.py --test-select=${{ matrix.test_select || 'native' }} ${{ (runner.os == 'Linux' && runner.arch == 'X64') && '--run-podman' || '' }}
|
||||||
uv run --no-sync bin/run_tests.py --test-select=${{ matrix.test_select || 'native' }} ${{ (runner.os == 'Linux' && runner.arch == 'X64') && '--run-podman' || '' }}
|
|
||||||
|
|
||||||
emulated-archs:
|
emulated-archs:
|
||||||
name: Get qemu emulated architectures
|
name: Get qemu emulated architectures
|
||||||
@@ -258,7 +278,7 @@ jobs:
|
|||||||
|
|
||||||
test-pyodide:
|
test-pyodide:
|
||||||
name: Test pyodide
|
name: Test pyodide
|
||||||
needs: lint
|
needs: sample
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 180
|
timeout-minutes: 180
|
||||||
steps:
|
steps:
|
||||||
@@ -272,9 +292,11 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: uv sync --no-dev --group test
|
run: uv sync --no-dev --group test
|
||||||
|
|
||||||
- name: Generate a sample project
|
- name: Download a sample project
|
||||||
run: |
|
uses: actions/download-artifact@v5
|
||||||
uv run --no-sync -m test.test_projects test.test_0_basic.basic_project sample_proj
|
with:
|
||||||
|
name: sample_proj
|
||||||
|
path: sample_proj
|
||||||
|
|
||||||
- name: Run a sample build (GitHub Action)
|
- name: Run a sample build (GitHub Action)
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -285,7 +307,43 @@ jobs:
|
|||||||
CIBW_PLATFORM: pyodide
|
CIBW_PLATFORM: pyodide
|
||||||
|
|
||||||
- name: Run tests with 'CIBW_PLATFORM' set to 'pyodide'
|
- name: Run tests with 'CIBW_PLATFORM' set to 'pyodide'
|
||||||
run: |
|
run: uv run --no-sync ./bin/run_tests.py
|
||||||
uv run --no-sync ./bin/run_tests.py
|
|
||||||
env:
|
env:
|
||||||
CIBW_PLATFORM: pyodide
|
CIBW_PLATFORM: pyodide
|
||||||
|
|
||||||
|
test-uv-extras:
|
||||||
|
name: Test uv extra on ${{ matrix.os }} ${{ matrix.test_select }}
|
||||||
|
needs: sample
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
test_select: android
|
||||||
|
- os: windows-latest
|
||||||
|
- os: windows-11-arm
|
||||||
|
- os: macos-15-intel
|
||||||
|
- os: macos-15
|
||||||
|
- os: macos-15-intel
|
||||||
|
test_select: android
|
||||||
|
- os: macos-15
|
||||||
|
test_select: android
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: Download a sample project
|
||||||
|
uses: actions/download-artifact@v5
|
||||||
|
with:
|
||||||
|
name: sample_proj
|
||||||
|
path: sample_proj
|
||||||
|
- name: Run a sample build (GitHub Action)
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
extras: uv
|
||||||
|
package-dir: sample_proj
|
||||||
|
output-dir: wheelhouse
|
||||||
|
env:
|
||||||
|
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
|
||||||
|
CIBW_BUILD: cp314-*
|
||||||
|
CIBW_BUILD_FRONTEND: 'build[uv]'
|
||||||
|
CIBW_PLATFORM: ${{ matrix.test_select }}
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ runs:
|
|||||||
from subprocess import run
|
from subprocess import run
|
||||||
|
|
||||||
EXTRAS = set(e.strip() for e in "${{ inputs.extras }}".split(",") if e.strip())
|
EXTRAS = set(e.strip() for e in "${{ inputs.extras }}".split(",") if e.strip())
|
||||||
if sys.platform == "linux":
|
|
||||||
EXTRAS.discard("uv")
|
|
||||||
|
|
||||||
|
|
||||||
class EnvBuilder(venv.EnvBuilder):
|
class EnvBuilder(venv.EnvBuilder):
|
||||||
|
|||||||
Reference in New Issue
Block a user