ensure sdists are installable (#361) #874
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: unit-tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| actions: none | |
| checks: none | |
| contents: read | |
| deployments: none | |
| discussions: none | |
| id-token: none | |
| issues: none | |
| packages: none | |
| pages: none | |
| pull-requests: none | |
| repository-projects: none | |
| security-events: none | |
| statuses: none | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: check out repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - name: build and check dists | |
| run: | | |
| python -m pip install -v \ | |
| --constraint ./constraints.txt \ | |
| -r ./requirements-check-dists.txt | |
| make build check-dists | |
| - name: upload sdist | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| - name: upload wheel | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: wheel | |
| path: dist/*.whl | |
| test-cpython: | |
| name: unit-tests (${{ matrix.os }}, Python-CPython ${{ matrix.python_version }}, ${{ matrix.package-type }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| needs: [build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| ######### | |
| # Linux # | |
| ######### | |
| - os: ubuntu-slim | |
| python_version: &oldest_python '3.9' | |
| package-type: sdist | |
| - os: ubuntu-slim | |
| python_version: '3.11' | |
| package-type: wheel | |
| - os: ubuntu-slim | |
| python_version: '3.12' | |
| package-type: wheel | |
| - os: ubuntu-slim | |
| python_version: '3.13' | |
| package-type: wheel | |
| - os: ubuntu-slim | |
| python_version: &latest_python '3.14' | |
| package-type: sdist | |
| ######### | |
| # macOS # | |
| ######### | |
| - os: macOS-15-intel | |
| python_version: *oldest_python | |
| package-type: wheel | |
| - os: macOS-latest | |
| python_version: *latest_python | |
| package-type: sdist | |
| ########### | |
| # Windows # | |
| ########### | |
| - os: windows-latest | |
| python_version: *oldest_python | |
| package-type: wheel | |
| - os: windows-latest | |
| python_version: *latest_python | |
| package-type: sdist | |
| steps: | |
| - name: Prevent conversion of line endings on Windows | |
| if: startsWith(matrix.os, 'windows') | |
| shell: pwsh | |
| run: git config --global core.autocrlf false | |
| - name: check out repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | |
| with: | |
| python-version: '${{ matrix.python_version }}' | |
| - name: Install extra tools on Linux | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y \ | |
| llvm | |
| - name: Install extra tools on Windows | |
| if: startsWith(matrix.os, 'windows') | |
| run: | | |
| choco install zip | |
| - name: download packages | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: ${{ matrix.package-type }} | |
| path: dist | |
| - name: install pydistcheck and testing dependencies | |
| shell: bash | |
| run: | | |
| python -m pip install \ | |
| -r ./requirements-tests.txt \ | |
| dist/* | |
| - name: test | |
| shell: bash | |
| run: | | |
| make test | |
| test-pypy: | |
| name: unit-tests (${{ matrix.os }}, Python-PyPy ${{ matrix.python_version }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| needs: [build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # available versions: | |
| # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#available-versions-of-python-pypy-and-graalpy | |
| - os: ubuntu-latest | |
| python_version: '3.11' | |
| steps: | |
| - name: check out repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | |
| with: | |
| python-version: 'pypy${{ matrix.python_version }}' | |
| - name: Install extra tools on Linux | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y \ | |
| llvm | |
| - name: download packages | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | |
| with: | |
| name: wheel | |
| path: dist | |
| - name: install pydistcheck and testing dependencies | |
| shell: bash | |
| run: | | |
| python -m pip install \ | |
| -r ./requirements-tests.txt \ | |
| dist/*.whl | |
| - name: test | |
| shell: bash | |
| run: | | |
| make test | |
| check-test-packages: | |
| name: check-test-packages (${{ matrix.os }}, Python ${{ matrix.python_version }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-slim | |
| python_version: '3.12' | |
| - os: macOS-15-intel | |
| python_version: '3.11' | |
| steps: | |
| - name: check out repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | |
| with: | |
| python-version: "${{ matrix.python_version }}" | |
| - name: run tests | |
| run: | | |
| bin/check-test-packages.sh ${GITHUB_WORKSPACE}/tests/data | |
| all-unit-tests-successful: | |
| if: always() | |
| runs-on: ubuntu-slim | |
| needs: | |
| - build | |
| - check-test-packages | |
| - test-cpython | |
| - test-pypy | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |