Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate github test matrix from tox #1422

Merged
merged 5 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Generate github test matrix from tox
We only want one static list of environments to run unit tests
and that list should come from tox.ini

This sets up tox-gh-matrix[1] to dynamically generate the list
of test environments for github actions to run. It will allow
us to consolidate the list to just one for easier maintenance
going forward.

[1] https://github.com/medmunds/tox-gh-matrix
zaro0508 committed Jan 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit aa97c39c1a89c38d40735cd72d0b677ed84a2ca9
18 changes: 15 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -47,26 +47,38 @@ jobs:
run: poetry install --no-interaction --all-extras
- name: build documentation
run: poetry run make html --directory docs
get-envlist:
runs-on: ubuntu-latest
outputs:
envlist: ${{ steps.generate-envlist.outputs.envlist }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- id: generate-envlist
run: poetry run tox --gh-matrix
unit-tests:
needs: get-envlist
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
tox: ${{ fromJSON(needs.get-envlist.outputs.envlist) }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.tox.python.spec }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: run python tests
run: poetry run tox -e py
run: poetry run tox -e ${{ matrix.tox.name }}
- name: run python test report
run: poetry run tox -e report
docker-build:
Loading