Skip to content

Commit 7dd5194

Browse files
committed
Github Action status for each tox combination
1 parent 4bad625 commit 7dd5194

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,26 @@ on:
99
- main
1010

1111
jobs:
12+
get-tox-envlist:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
envlist: ${{ steps.generate-tox-envlist.outputs.envlist }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
- run: |
19+
python -m pip install --upgrade pip
20+
python -m pip install tox tox-gh-matrix
21+
- id: generate-tox-envlist
22+
run: python -m tox --gh-matrix
23+
1224
build:
13-
name: build (Python ${{ matrix.python-version }})
25+
name: Test ${{ matrix.tox.name }}
1426
runs-on: ubuntu-latest
27+
needs: get-tox-envlist
1528
strategy:
1629
fail-fast: false
1730
matrix:
18-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
31+
tox: ${{ fromJSON(needs.get-tox-envlist.outputs.envlist) }}
1932

2033
# Service containers to run with `container-job`
2134
services:
@@ -36,22 +49,21 @@ jobs:
3649
steps:
3750
- uses: actions/checkout@v2
3851

39-
- name: Set up Python ${{ matrix.python-version }}
40-
uses: actions/setup-python@v2
52+
- name: Setup Python ${{ matrix.tox.python.version }}
53+
uses: actions/setup-python@v4
4154
with:
42-
python-version: ${{ matrix.python-version }}
55+
python-version: ${{ matrix.tox.python.spec }}
4356

4457
- name: Install dependencies
4558
run: |
4659
python -m pip install --upgrade pip
47-
python -m pip install --upgrade tox tox-gh-actions
60+
python -m pip install --upgrade tox
4861
4962
- name: Tox tests
50-
run: |
51-
tox -v
63+
run: python -m tox -v -e ${{ matrix.tox.name }}
5264

5365
- name: Install codecov
5466
run: python -m pip install codecov
5567

5668
- name: Upload coverage
57-
run: python -m codecov --name "Python ${{ matrix.python-version }}"
69+
run: python -m codecov --name "Python ${{ matrix.tox.python.spec }}"

tox.ini

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ envlist =
1111
py{38,39,310,311}-fl{20,21,22}
1212
py{38,39,310,311}-s{21,22}
1313

14-
[gh-actions]
15-
python =
16-
3.8: py38
17-
3.9: py39
18-
3.10: py310
19-
3.11: py311
20-
3.12: py312
21-
2214
[testenv]
2315
usedevelop = true
2416
pip_pre = true

0 commit comments

Comments
 (0)