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

ci: remove skipped job & combine (faster) #771

Merged
merged 2 commits into from
Feb 23, 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
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
tox-version: ["latest", "<4"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -37,8 +36,11 @@ jobs:
- name: Install Nox-under-test
run: |
python -m pip install --disable-pip-version-check .
- name: Run tests on ${{ matrix.os }}
run: nox --non-interactive --error-on-missing-interpreter --session "tests(python='${{ matrix.python-version }}', tox_version='${{ matrix.tox-version }}')" -- --full-trace
- name: Run tests on ${{ matrix.os }} (tox <4)
run: nox --non-interactive --error-on-missing-interpreter --session "tests(python='${{ matrix.python-version }}', tox_version='<4')" -- --full-trace
- name: Run tox-to-nox tests on ${{ matrix.os }} (tox latest)
run: nox --non-interactive --error-on-missing-interpreter --session "tests(python='${{ matrix.python-version }}', tox_version='latest')" -- tests/test_tox_to_nox.py --full-trace
if: matrix.python-version != '3.7'
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 4 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,21 @@
nox.options.sessions.append("conda_tests")


# Because there is a dependency conflict between argcomplete and the latest tox
# (both depend on a different version of importlibmetadata for Py 3.7) pip
# installs tox 3 as the latest one for Py 3.7.
@nox.session
@nox.parametrize(
"python, tox_version",
[
(python, tox_version)
for python in ("3.7", "3.8", "3.9", "3.10", "3.11", "3.12")
for tox_version in ("latest", "<4")
if (python, tox_version) != ("3.7", "latest")
],
)
def tests(session: nox.Session, tox_version: str) -> None:
"""Run test suite with pytest."""
# Because there is a dependency conflict between
# argcomplete and the latest tox (both depend on
# a different version of importlibmetadata for Py 3.7)
# pip installs tox 3 as the latest one for Py 3.7.
if session.python == "3.7" and tox_version == "latest":
return

coverage_file = (
f".coverage.{sys.platform}.{session.python}.tox{tox_version.lstrip('<')}"
Expand Down
Loading