Skip to content

Commit

Permalink
Switch to tox & explicit list
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Mar 27, 2024
1 parent 094b511 commit 3fa34b1
Showing 1 changed file with 30 additions and 9 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/ci-supported-pythons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,48 @@ jobs:
path: sampleproject

outputs:
python-versions: ${{ steps.baipp.outputs.supported_pythons_json_job_matrix_value }}
python-versions: ${{ steps.baipp.outputs.supported_pythons_json_array }}
# If your matrix consists only of Python versions, you can use the
# following, too:
# python-versions: ${{ steps.baipp.outputs.supported_pythons_json_job_matrix_value }}

test-package:
needs: build-package
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.build-package.outputs.python-versions) }}
matrix:
# Create matrix from the 'python-versions' output from the build-package
# job.
python-version: ${{ fromJson(needs.build-package.outputs.python-versions) }}

# If you set 'python-versions' to
# 'supported_pythons_json_job_matrix_value'
# above, you would set the matrix like this instead:
# matrix: ${{ fromJson(needs.build-package.outputs.python-versions) }}


steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install pytest
- uses: actions/download-artifact@v4

- name: Download built packages from the build-package job.
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- run: pip install dist/*.whl
- uses: actions/checkout@v4
with:
repository: pypa/sampleproject
- run: python -Im pytest tests/

- name: Prepare tests & config
run: |
# We use tox together with the fast tox-uv plugin.
python -Im pip install tox-uv
# Unpack SDist for tests & config files.
tar xf dist/*.tar.gz --strip-components=1
# Ensure tests run against wheel.
rm -rf src
- run: python -Im tox run --installpkg dist/*.whl -f py$(echo ${{ matrix.python-version }} | tr -d .)

...

0 comments on commit 3fa34b1

Please sign in to comment.