Modernize build/install to pyproject.toml #103
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: Integration Tests | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| # Single source of truth: the oldest supported Python is whatever pyproject.toml | |
| # declares in `requires-python`. Every job below derives its cross-version | |
| # target from this output instead of hardcoding a version. | |
| min-python: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.minpy.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Read minimum supported Python from pyproject.toml | |
| id: minpy | |
| run: | | |
| version=$(grep requires-python pyproject.toml | grep -oE '[0-9]+\.[0-9]+' | head -1) | |
| echo "Minimum supported Python: $version" | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| archlinux: | |
| needs: min-python | |
| runs-on: ubuntu-latest | |
| container: | |
| # archlinux:latest ships the newest CPython (rolling release), so this | |
| # job exercises fades against the bleeding-edge Python. An older | |
| # interpreter for the cross-version test is provided via uv at runtime. | |
| image: archlinux:latest | |
| volumes: | |
| - ${{ github.workspace }}:/fades | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: | | |
| pacman -Suy --noconfirm python3 python-packaging uv git | |
| - name: Simple fades run (newest Python) | |
| run: | | |
| cd /fades | |
| python3 -m fades -v -d pytest -x pytest --version | |
| - name: Using the oldest supported Python | |
| env: | |
| OLDEST: ${{ needs.min-python.outputs.version }} | |
| run: | | |
| cd /fades | |
| uv python install "$OLDEST" | |
| OLD=$(uv python find "$OLDEST") | |
| python -m fades -v --python="$OLD" -d pytest -x pytest -v --integtest-pyversion="$OLDEST" tests/integtest.py | |
| fedora: | |
| needs: min-python | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:latest | |
| volumes: | |
| - ${{ github.workspace }}:/fades | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: | | |
| dnf install --assumeyes python3 python3-packaging uv git | |
| - name: Simple fades run | |
| run: | | |
| cd /fades | |
| python3 -m fades -v -d pytest -x pytest --version | |
| - name: Using the oldest supported Python | |
| env: | |
| OLDEST: ${{ needs.min-python.outputs.version }} | |
| run: | | |
| cd /fades | |
| uv python install "$OLDEST" | |
| OLD=$(uv python find "$OLDEST") | |
| python3 -m fades -v --python="$OLD" -d pytest -x pytest -v --integtest-pyversion="$OLDEST" tests/integtest.py | |
| native-windows: | |
| needs: min-python | |
| strategy: | |
| matrix: | |
| # just a selection otherwise it's too much | |
| # - latest OS (left here even if it's only one to simplify upgrading later) | |
| # - oldest (from pyproject.toml) and newest Python | |
| os: [windows-2025] | |
| python-version: ["${{ needs.min-python.outputs.version }}", "3.13"] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| uses: actions/setup-python@v5 | |
| id: matrixpy | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Also set up the oldest supported Python for cross-Python test | |
| uses: actions/setup-python@v5 | |
| id: otherpy | |
| with: | |
| python-version: ${{ needs.min-python.outputs.version }} | |
| - name: Install dependencies | |
| run: | | |
| ${{ steps.matrixpy.outputs.python-path }} -m pip install -U packaging | |
| - name: Simple fades run | |
| run: | | |
| ${{ steps.matrixpy.outputs.python-path }} -m fades -v -d pytest -x pytest --version | |
| - name: Using a different Python | |
| run: | | |
| ${{ steps.matrixpy.outputs.python-path }} -m fades -v --python=${{ steps.otherpy.outputs.python-path }} -d pytest -x pytest -v --integtest-pyversion=${{ needs.min-python.outputs.version }} tests/integtest.py | |
| native-generic: | |
| needs: min-python | |
| strategy: | |
| matrix: | |
| # just a selection otherwise it's too much | |
| # - latest OSes | |
| # - oldest (from pyproject.toml) and newest Python | |
| os: [ubuntu-24.04, macos-15] | |
| python-version: ["${{ needs.min-python.outputs.version }}", "3.13"] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| uses: actions/setup-python@v5 | |
| id: matrixpy | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Also set up the oldest supported Python for cross-Python test | |
| uses: actions/setup-python@v5 | |
| id: otherpy | |
| with: | |
| python-version: ${{ needs.min-python.outputs.version }} | |
| - name: Install dependencies | |
| run: | | |
| ${{ steps.matrixpy.outputs.python-path }} -m pip install -U packaging | |
| - name: Simple fades run | |
| run: | | |
| ${{ steps.matrixpy.outputs.python-path }} -m fades -v -d pytest -x pytest --version | |
| - name: Using a different Python | |
| run: | | |
| ${{ steps.matrixpy.outputs.python-path }} -m fades -v --python=${{ steps.otherpy.outputs.python-path }} -d pytest -x pytest -v --integtest-pyversion=${{ needs.min-python.outputs.version }} tests/integtest.py |