Bump minor version to v13.1.0
#1268
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: 🔬 Tests | |
| "on": | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - extra_platforms/** | |
| - tests/** | |
| - pyproject.toml | |
| - uv.lock | |
| - .github/workflows/tests.yaml | |
| pull_request: | |
| branches-ignore: | |
| # This filter matches the PR's *base* branch (always `main`), not its | |
| # head, so it does not actually exclude these PRs — see | |
| # https://github.com/actions/runner/issues/1591. The real skip is the | |
| # `github.head_ref` check in the `metadata` job's `if:` below. Kept | |
| # here as documentation of intent. | |
| - major-version-increment | |
| - minor-version-increment | |
| - prepare-release | |
| paths: | |
| - extra_platforms/** | |
| - tests/** | |
| - pyproject.toml | |
| - uv.lock | |
| - .github/workflows/tests.yaml | |
| schedule: | |
| # Run tests monthly to catch regressions from dependency or environment changes. | |
| - cron: "17 9 1 * *" | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ !startsWith(github.event.head_commit.message, '[changelog] Release') }} | |
| jobs: | |
| metadata: | |
| name: 🧬 Project metadata | |
| runs-on: ubuntu-slim | |
| outputs: | |
| metadata: ${{ steps.metadata.outputs.metadata }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82 # v7.5.0 | |
| - name: Run repomatic metadata | |
| id: metadata | |
| run: > | |
| uvx --no-progress 'repomatic==6.14.0' metadata | |
| --format github-json --output "$GITHUB_OUTPUT" | |
| test_matrix test_matrix_pr | |
| tests: | |
| needs: | |
| - metadata | |
| strategy: | |
| fail-fast: false | |
| # Matrix is pre-computed by repomatic metadata. PRs get a reduced matrix | |
| # (fewer OS variants and Python versions) to save CI minutes. | |
| matrix: >- | |
| ${{ github.event_name != 'pull_request' | |
| && fromJSON(needs.metadata.outputs.metadata).test_matrix | |
| || fromJSON(needs.metadata.outputs.metadata).test_matrix_pr }} | |
| name: "${{ matrix.state == 'stable' && '✅' || '⁉️' }} ${{ matrix.os }} / py${{ matrix.python-version }}" | |
| runs-on: ${{ matrix.os }} | |
| # We keep going when a job flagged as not stable fails. | |
| continue-on-error: ${{ matrix.state == 'unstable' }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82 # v7.5.0 | |
| - name: Force native ARM64 Python on Windows ARM64 | |
| # Workaround for https://github.com/astral-sh/uv/issues/12906: uv defaults to x86_64 Python on ARM64 Windows, | |
| # relying on transparent emulation. Native extensions with Rust (e.g., test-results-parser from codecov-cli) | |
| # fail to compile because the ARM64 Rust toolchain lacks the x86_64-pc-windows-msvc target. Setting UV_PYTHON | |
| # to an architecture-qualified specifier forces uv (and uvx) to use native ARM64 Python for all steps. | |
| if: runner.os == 'Windows' && runner.arch == 'ARM64' | |
| shell: bash | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python-version }} | |
| run: echo "UV_PYTHON=cpython-${PYTHON_VERSION}-aarch64" >> "$GITHUB_ENV" | |
| - name: Install Python ${{ matrix.python-version }} | |
| # If UV cannot find the requested Python version, it exits with code 2, which let the job pass unnoticed on | |
| # Windows. So we force the shell to bash, even on Windows, and "set -e" to ensure any error in the install | |
| # process is caught and fails the job. It works because Windows runners too Git Bash available). | |
| shell: bash | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python-version }} | |
| run: | | |
| set -e | |
| uv --no-progress venv --python "${UV_PYTHON:-${PYTHON_VERSION}}" | |
| - name: Force UTF-8 encoding on Windows | |
| # Workaround for https://github.com/pallets/click/issues/2121: Windows GitHub Actions runners | |
| # redirect command output to files, which sets the encoding to the system default (cp1252). | |
| # Python CLI frameworks like Click then raise UnicodeEncodeError on non-ASCII output. | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: echo "PYTHONIOENCODING=utf8" >> "$GITHUB_ENV" | |
| - name: Install project | |
| # Install all extras, so we can check any incompatibility. | |
| run: uv --no-progress sync --frozen --all-extras --group test --group docs | |
| - name: Run local CLI | |
| run: uv run -- extra-platforms | |
| - name: Run CLI from module | |
| run: | | |
| uv run -m extra_platforms | |
| uv run python -m extra_platforms | |
| - name: Unittests | |
| env: | |
| # Used by github_runner_os() in tests/test_detection.py to extract the GitHub runner image ID. | |
| EXTRA_PLATFORMS_TEST_MATRIX: ${{ toJson(matrix) }} | |
| run: > | |
| uv --no-progress run --frozen -- pytest | |
| --dist=loadgroup | |
| --numprocesses=auto | |
| --cov | |
| --cov-report=term | |
| --cov-report=xml | |
| --junitxml=junit.xml | |
| --override-ini=junit_family=legacy | |
| - name: Upload coverage to Codecov | |
| # Skip on prepare-release PRs (Codecov cannot create commits on protected | |
| # branches), sync-repomatic PRs (data-only changes with no coverable | |
| # lines), and fork PRs (secrets are not available). | |
| if: > | |
| github.head_ref != 'prepare-release' | |
| && github.head_ref != 'sync-repomatic' | |
| && env.CODECOV_TOKEN != '' | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| shell: bash | |
| run: > | |
| uvx --no-progress 'codecov-cli==11.2.8' | |
| --auto-load-params-from githubactions | |
| upload-process | |
| --git-service github | |
| --report-type coverage | |
| --token "${CODECOV_TOKEN}" | |
| - name: Upload test results to Codecov | |
| if: > | |
| github.head_ref != 'prepare-release' | |
| && github.head_ref != 'sync-repomatic' | |
| && env.CODECOV_TOKEN != '' | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| shell: bash | |
| run: > | |
| uvx --no-progress 'codecov-cli==11.2.8' | |
| --auto-load-params-from githubactions | |
| upload-process | |
| --git-service github | |
| --report-type test_results | |
| --token "${CODECOV_TOKEN}" | |
| test-package-install: | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-24.04-arm # arm64 | |
| - ubuntu-slim # x86 | |
| - ubuntu-24.04 # x86 | |
| - ubuntu-22.04-arm # arm64 | |
| - ubuntu-22.04 # x86 | |
| - macos-26 # arm64 | |
| - macos-15 # arm64 | |
| - macos-15-intel # x86 | |
| - macos-14 # arm64 | |
| - windows-11-arm # arm64 | |
| - windows-2025 # x86 | |
| - windows-2022 # x86 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82 # v7.5.0 | |
| with: | |
| # windows-2025 runners have only Python 3.9 installed. | |
| python-version: ${{ matrix.os == 'windows-2025' && '3.10' || ''}} | |
| - name: Run stable CLI | |
| run: | | |
| uvx extra-platforms | |
| uvx --from extra-platforms -- extra-platforms | |
| uv run --with extra-platforms -- extra-platforms | |
| uv run --with extra-platforms -m extra_platforms | |
| uv run --with extra-platforms python -m extra_platforms | |
| - name: Run dev CLI | |
| run: | | |
| uvx --from git+https://github.com/kdeldycke/extra-platforms -- extra-platforms | |
| uv run --with git+https://github.com/kdeldycke/extra-platforms -- extra-platforms | |
| uv run --with git+https://github.com/kdeldycke/extra-platforms -m extra_platforms | |
| uv run --with git+https://github.com/kdeldycke/extra-platforms python -m extra_platforms | |
| - name: Run stable CLI via uv tool | |
| run: | | |
| uv --no-progress tool install extra-platforms | |
| extra-platforms | |
| uv --no-progress tool uninstall extra-platforms | |
| - name: Run dev CLI via uv tool | |
| run: | | |
| uv --no-progress tool install git+https://github.com/kdeldycke/extra-platforms | |
| extra-platforms | |
| uv --no-progress tool uninstall extra-platforms | |
| - name: Run CLI via pipx | |
| run: | | |
| uv --no-progress tool install pipx | |
| pipx run extra-platforms | |
| pipx run --spec extra-platforms extra-platforms | |
| pipx run --spec git+https://github.com/kdeldycke/extra-platforms extra-platforms | |
| uv --no-progress tool uninstall pipx | |
| - name: Run CLI via pip | |
| run: | | |
| pip install extra-platforms | |
| extra-platforms |