Skip to content

Commit

Permalink
dynamic matrix content based on input
Browse files Browse the repository at this point in the history
  • Loading branch information
sbilge committed Jun 19, 2024
1 parent b003ac5 commit ec1c274
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,37 @@ jobs:
with:
path: ./dist

define-matrix:
runs-on: ubuntu-latest
outputs:
versions: $
steps:
- name: Define python versions
run: |
PYTHON_LATEST=${{ inputs.python_latest }}
if $PYTHON_LATEST; then
echo '["3.12"]' >> "$GITHUB_OUTPUT"
else
echo '["3.9", "3.10", "3.11", "3.12"]' >> "$GITHUB_OUTPUT"
fi

test-package:
name: Test Freshly Built Package
needs: build-package
needs:
- build-package
- define-matrix
runs-on: ubuntu-latest
strategy:
matrix:
python_latest: [true, false]
python-version: [3.9, 3.10, 3.11, 3.12]
exclude:
- python_latest: true
python-version: 3.9
- python_latest: true
python-version: 3.10
- python_latest: true
python-version: 3.11

python-version: ${{ fromJSON(needs.define-matrix.outputs.versions) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download dist content
uses: actions/download-artifact@v4

# - name: Test with Python 3.12 using the test-package action
# if: ${{ inputs.python_latest }}
# uses: ghga-de/gh-action-pypi/test-package@main
# with:
# python_version: 3.12

- name: Test using the test-package action
if: ${{ !inputs.python_latest }}
uses: ghga-de/gh-action-pypi/test-package@main
with:
python_version: ${{ matrix.python-version }}
Expand Down

0 comments on commit ec1c274

Please sign in to comment.