Skip to content

Commit

Permalink
Github Action status for each tox combination (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem authored Mar 1, 2024
1 parent 6b9e191 commit 6a6c78a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,26 @@ on:
- main

jobs:
get-tox-envlist:
runs-on: ubuntu-latest
outputs:
envlist: ${{ steps.generate-tox-envlist.outputs.envlist }}
steps:
- uses: actions/checkout@v3
- run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-matrix
- id: generate-tox-envlist
run: python -m tox --gh-matrix

build:
name: build (Python ${{ matrix.python-version }})
name: Test ${{ matrix.tox.name }}
runs-on: ubuntu-latest
needs: get-tox-envlist
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
tox: ${{ fromJSON(needs.get-tox-envlist.outputs.envlist) }}

# Service containers to run with `container-job`
services:
Expand All @@ -36,22 +49,21 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Setup Python ${{ matrix.tox.python.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.tox.python.spec }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
python -m pip install --upgrade tox
- name: Tox tests
run: |
tox -v
run: python -m tox -v -e ${{ matrix.tox.name }}

- name: Install codecov
run: python -m pip install codecov

- name: Upload coverage
run: python -m codecov --name "Python ${{ matrix.python-version }}"
run: python -m codecov --name "Python ${{ matrix.tox.python.spec }}"
8 changes: 0 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ envlist =
py{38,39,310,311}-fl{20,21,22}
py{38,39,310,311}-s{21,22}

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
usedevelop = true
pip_pre = true
Expand Down

0 comments on commit 6a6c78a

Please sign in to comment.