We don't need wheel anymore #24
This file contains 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: Use JSON output to build job matrix | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
env: | |
FORCE_COLOR: "1" # Make tools pretty. | |
jobs: | |
build-package: | |
name: Build & verify package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: hynek/structlog | |
path: structlog | |
- uses: actions/checkout@v4 | |
with: | |
path: action | |
- uses: ./action | |
id: baipp | |
with: | |
path: structlog | |
outputs: | |
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | |
# If your matrix consists only of Python versions, you can use the | |
# following, too: | |
# python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_job_matrix_value }} | |
test-package: | |
needs: build-package | |
runs-on: ubuntu-latest | |
strategy: | |
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_python_classifiers_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 }} | |
- name: Download built packages from the build-package job. | |
uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- 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 .) | |
... |