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 #7

Merged
merged 2 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
21 changes: 18 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,40 @@ jobs:
run: poetry install --no-interaction --all-extras
- name: build package
run: poetry build
# use https://github.com/medmunds/tox-gh-matrix to export tox envlist to GH actions
get-tox-envlist:
runs-on: ubuntu-latest
outputs:
envlist: ${{ steps.generate-envlist.outputs.envlist }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- id: generate-envlist
run: poetry run tox --gh-matrix
unit-tests:
needs: get-tox-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-tox-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
194 changes: 105 additions & 89 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ classifiers = [
"custom" = "template_handler.custom:Custom"

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
python = "^3.8"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.2.1"
tox = "^4.0.0"
pytest = "^7.2.2"
tox = "^3.23.0"
pytest = "^7.4.3"
pytest-cov = "^4.0.0"
sceptre = ">3.2"
sceptre = "^4.0"
tox-gh-matrix = "^0.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down