Skip to content

Commit 2ee872e

Browse files
committed
Github Action status for each tox combination
1 parent 4bad625 commit 2ee872e

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,24 @@ 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: python -m pip install tox tox-gh-matrix
19+
- id: generate-tox-envlist
20+
run: python -m tox --gh-matrix
21+
1222
build:
13-
name: build (Python ${{ matrix.python-version }})
23+
name: Test ${{ matrix.tox.name }}
1424
runs-on: ubuntu-latest
25+
needs: get-tox-envlist
1526
strategy:
1627
fail-fast: false
1728
matrix:
18-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
29+
tox: ${{ fromJSON(needs.generate-tox-envlist.outputs.envlist) }}
1930

2031
# Service containers to run with `container-job`
2132
services:
@@ -36,22 +47,21 @@ jobs:
3647
steps:
3748
- uses: actions/checkout@v2
3849

39-
- name: Set up Python ${{ matrix.python-version }}
40-
uses: actions/setup-python@v2
50+
- name: Setup Python ${{ matrix.tox.python.version }}
51+
uses: actions/setup-python@v4
4152
with:
42-
python-version: ${{ matrix.python-version }}
53+
python-version: ${{ matrix.tox.python.spec }}
4354

4455
- name: Install dependencies
4556
run: |
4657
python -m pip install --upgrade pip
47-
python -m pip install --upgrade tox tox-gh-actions
58+
python -m pip install --upgrade tox
4859
4960
- name: Tox tests
50-
run: |
51-
tox -v
61+
run: python -m tox -v -e ${{ matrix.tox.name }}
5262

5363
- name: Install codecov
5464
run: python -m pip install codecov
5565

5666
- name: Upload coverage
57-
run: python -m codecov --name "Python ${{ matrix.python-version }}"
67+
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)