Seamless integration of tox into GitHub Actions

3.5.0 · active · verified Mon Apr 13

tox-gh-actions is a `tox` plugin that provides seamless integration of your `tox` test environments with GitHub Actions, automatically detecting Python versions from your workflow matrix and setting up problem matchers. It is an actively maintained library with frequent releases to support new Python versions and address issues.

Warnings

Install

Imports

Quickstart

This GitHub Actions workflow demonstrates how to use `tox-gh-actions`. It sets up a matrix of Python versions, installs `tox` and `tox-gh-actions`, and then simply runs `tox`. The plugin automatically detects the Python version from the `python-version` matrix variable and maps it to the appropriate `tox` environment.

name: Test

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.8", "3.9", "3.10", "3.11"]

    steps:
    - uses: actions/checkout@v4
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install tox tox-gh-actions
    - name: Run tox
      run: tox

view raw JSON →