Skip to content

Commit

Permalink
Launch tests with pytest in tox (#117)
Browse files Browse the repository at this point in the history
Co-authored-by: Romain Pesche <[email protected]>
Co-authored-by: Mithil Poojary <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2021
1 parent 9315c89 commit 6097255
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
49 changes: 39 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,37 @@ on:
branches: [master]

jobs:
build:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install black dependencies
run: |
python -m pip install --upgrade pip
pip install black
- name: Check if linted with black
run: |
black --check .
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install isort
- name: Check if imports are sorted
run: |
isort --profile black . --check
tests:
needs: [black, lint]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -22,16 +47,20 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black tox sphinx sphinx_rtd_theme isort --use-feature=2020-resolver
- name: Check if linted with black
run: |
black --check .
- name: Check if imports are sorted
run: |
isort --profile black . --check
pip install tox --use-feature=2020-resolver
- name: Test with tox
run: |
tox .
doc:
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx_rtd_theme --use-feature=2020-resolver
- name: Build docs
run: |
python setup.py build_sphinx
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[tox]
envlist = py3

[testenv]
deps = pytest
commands =
pytest

0 comments on commit 6097255

Please sign in to comment.