Skip to content

Commit b392a9e

Browse files
authored
Merge pull request #594 from pytest-dev/tox-4
Tox 4
2 parents 93c55f1 + 6287909 commit b392a9e

File tree

6 files changed

+384
-327
lines changed

6 files changed

+384
-327
lines changed

.github/workflows/main.yml

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,81 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
build:
10-
9+
test-run:
1110
runs-on: ubuntu-latest
1211
strategy:
1312
matrix:
14-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
13+
include:
14+
- python-version: "3.7"
15+
toxfactor: py37
16+
ignore-typecheck-outcome: true
17+
ignore-test-outcome: false
18+
- python-version: "3.8"
19+
toxfactor: py38
20+
ignore-typecheck-outcome: true
21+
ignore-test-outcome: false
22+
- python-version: "3.9"
23+
toxfactor: py39
24+
ignore-typecheck-outcome: true
25+
ignore-test-outcome: false
26+
- python-version: "3.10"
27+
toxfactor: py310
28+
ignore-typecheck-outcome: true
29+
ignore-test-outcome: false
30+
- python-version: "3.11"
31+
toxfactor: py311
32+
ignore-typecheck-outcome: true
33+
ignore-test-outcome: false
34+
- python-version: "3.12.0-alpha.3"
35+
toxfactor: py312
36+
ignore-typecheck-outcome: true
37+
ignore-test-outcome: true
1538

1639
steps:
1740
- uses: actions/checkout@v3
41+
1842
- name: Set up Python ${{ matrix.python-version }}
1943
uses: actions/setup-python@v4
44+
id: setup-python
2045
with:
2146
python-version: ${{ matrix.python-version }}
22-
- name: Install dependencies
47+
48+
- name: Install poetry
49+
run: |
50+
python -m pip install poetry==1.3.1
51+
52+
- name: Configure poetry
53+
run: |
54+
python -m poetry config virtualenvs.in-project true
55+
56+
- name: Cache the virtualenv
57+
id: poetry-dependencies-cache
58+
uses: actions/cache@v3
59+
with:
60+
path: ./.venv
61+
key: ${{ runner.os }}-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
62+
63+
- name: Install dev dependencies
64+
if: steps.poetry-dependencies-cache.outputs.cache-hit != 'true'
2365
run: |
24-
python -m pip install --upgrade pip
25-
pip install -U setuptools
26-
pip install tox coverage[toml]
66+
python -m poetry install --only=dev
67+
2768
- name: Type checking
28-
continue-on-error: true
69+
# Ignore errors for older pythons
70+
continue-on-error: ${{ matrix.ignore-typecheck-outcome }}
2971
run: |
72+
source .venv/bin/activate
3073
tox -e mypy
74+
3175
- name: Test with tox
32-
env:
33-
TOX_PARALLEL_NO_SPINNER: 1
76+
continue-on-error: ${{ matrix.ignore-test-outcome }}
3477
run: |
78+
source .venv/bin/activate
3579
coverage erase
36-
tox --parallel
80+
tox run-parallel -f ${{ matrix.toxfactor }} --parallel-no-spinner --parallel-live
3781
coverage combine
3882
coverage xml
83+
3984
- uses: codecov/codecov-action@v3
4085
with:
4186
fail_ci_if_error: true

0 commit comments

Comments
 (0)