diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 0000000..5d6a644 --- /dev/null +++ b/.github/workflows/tox.yml @@ -0,0 +1,49 @@ +name: run tox + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + push: + branches: + - 'master' + - 'tox-test' + release: + types: [published] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.8", "3.9"] + testsuite: ["minimal"] # "full" + steps: + - uses: actions/checkout@master + - name: set up python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: install system dependencies (linux) + if: runner.os == 'Linux' + # only managed to install system dependencies on Linux runners + run: | + sudo apt update + sudo apt install libgmp-dev libmpfr-dev libmpc-dev + - name: install python dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: run tox (linux) + # since system dependencies could only be installed on Linux runners, we run the "full" suite only on Linux ... + if: runner.os == 'Linux' + run: tox -e py-${{ matrix.testsuite }} -- --hypothesis-profile=ci + - name: run tox (macos or windows - minimal) + if: runner.os != 'Linux' && matrix.testsuite == 'minimal' + run: tox -e py-minimal -- --hypothesis-profile=ci + - name: run tox (macos or windows - recommendedextra) + # ... on all other OS we run the "recommendedextra" suite instead of the "full" suite + if: runner.os != 'Linux' && matrix.testsuite == 'full' + run: tox -e py-recommendedextra -- --hypothesis-profile=ci diff --git a/.gitignore b/.gitignore index dfbed08..804cbed 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ docs/source/_examples .DS_Store .vscode/ + +*.tox diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..a1e39e6 --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py38,py39,py-minimal + +[testenv] +# install pytest in the virtualenv where commands will be executed +deps = pytest +commands = + # NOTE: you can run any command line tool here - not just tests + pytest