diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3ef542..69b54fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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 }}" diff --git a/tox.ini b/tox.ini index e76aa0d..aa8c46e 100644 --- a/tox.ini +++ b/tox.ini @@ -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