Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzymadness committed Feb 20, 2023
1 parent b6b590b commit 610ed30
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on:
push:
branches: [main]
branches: [tox4]
pull_request:

env:
Expand All @@ -16,8 +16,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-20.04]
python-version: ["3.7", "3.8"]
tox-version: ["latest", "<4"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -35,7 +36,33 @@ jobs:
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-${{ matrix.python-version }}" -- --full-trace
run: nox --non-interactive --error-on-missing-interpreter --session "tests(python='${{ matrix.python-version }}', tox_version='${{ matrix.tox-version }}')" -- --full-trace
- name: Save coverage report
uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage.*

coverage:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Nox-under-test
run: |
python -m pip install --disable-pip-version-check .
- name: Download individual coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
- name: Display structure of downloaded files
run: ls -R
- name: Run coverage
run: nox --non-interactive --session "cover"

lint:
runs-on: ubuntu-latest
Expand Down
10 changes: 8 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@
(python, tox_version)
for python in ("3.7", "3.8", "3.9", "3.10", "3.11")
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

session.create_tmp() # Fixes permission errors on Windows
session.install("-r", "requirements-test.txt")
session.install("-e", ".[tox_to_nox]")
Expand All @@ -55,7 +61,7 @@ def tests(session: nox.Session, tox_version: str) -> None:
"pyproject.toml",
"--cov-report=",
*session.posargs,
env={"COVERAGE_FILE": f".coverage.{session.python}.{tox_version}"},
env={"COVERAGE_FILE": f".coverage.{session.python}.tox.{tox_version.lstrip('<')}"},
)


Expand Down

0 comments on commit 610ed30

Please sign in to comment.