Skip to content

Commit

Permalink
Enable tox tests and github actions around it
Browse files Browse the repository at this point in the history
  • Loading branch information
AthKouloumvakos committed Jan 30, 2024
1 parent 3a49f49 commit 7ab3a40
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ docs/source/_build
.DS_Store

.vscode/

*.tox
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7ab3a40

Please sign in to comment.