Skip to content

Commit

Permalink
maint(testing): run tests in stages on actions
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarbenjamin committed Dec 11, 2020
1 parent 25b6528 commit a0654e9
Showing 1 changed file with 67 additions and 15 deletions.
82 changes: 67 additions & 15 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,73 @@ jobs:
# -------------------- Code quality ------------------------------ #

code-quality:

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- run: python -m pip install --upgrade pip
- run: pip install mpmath flake8
- run: bin/test quality
- run: flake8 sympy

# -------------------- Doctests ---------------------------------- #
# -------------------- Doctests latest Python -------------------- #

doctests:
doctests-latest:
needs: code-quality

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: python -m pip install --upgrade pip
- run: pip install mpmath
- run: bin/doctest --force-colors
- run: examples/all.py -q

# -------------------- Test split 1/2 latest Python -------------- #

tests1-latest:
needs: code-quality

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: python -m pip install --upgrade pip
- run: pip install mpmath
- run: bin/test --force-colors --split=1/2

# -------------------- Test split 2/2 latest Python -------------- #

tests2-latest:
needs: code-quality

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: python -m pip install --upgrade pip
- run: pip install mpmath
- run: bin/test --force-colors --split=2/2

# -------------------- Doctests older Python --------------------- #

doctests:
needs: [doctests-latest, tests1-latest, tests2-latest]

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -43,15 +90,15 @@ jobs:
- run: bin/doctest --force-colors
- run: examples/all.py -q

# -------------------- Test split 1/2 ---------------------------- #
# -------------------- Test split 1/2 older Python --------------- #

tests1:
needs: code-quality
needs: [doctests-latest, tests1-latest, tests2-latest]

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -61,15 +108,15 @@ jobs:
- run: pip install mpmath
- run: bin/test --force-colors --split=1/2

# -------------------- Test split 2/2 ---------------------------- #
# -------------------- Test split 2/2 older Python --------------- #

tests2:
needs: code-quality
needs: [doctests-latest, tests1-latest, tests2-latest]

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -82,34 +129,38 @@ jobs:
# -------------------- Slow test split 1/2 ----------------------- #

slow1:
needs: code-quality
needs: [doctests-latest, tests1-latest, tests2-latest]

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- run: python -m pip install --upgrade pip
- run: pip install mpmath
- run: TRAVIS_BUILD_NUMBER=true bin/test --force-colors --slow --timeout=595 --split=1/2

# -------------------- Slow test split 2/2 ----------------------- #

slow2:
needs: code-quality
needs: [doctests-latest, tests1-latest, tests2-latest]

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- run: python -m pip install --upgrade pip
- run: pip install mpmath
- run: TRAVIS_BUILD_NUMBER=true bin/test --force-colors --slow --timeout=595 --split=2/2

# -------------------- Optional dependency tests ----------------- #

optional-dependencies:
needs: [doctests-latest, tests1-latest, tests2-latest]

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -127,7 +178,8 @@ jobs:
# -------------------- Build the html/latex docs ----------------- #

sphinx:
needs: code-quality
needs: [doctests-latest, tests1-latest, tests2-latest]

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand Down

0 comments on commit a0654e9

Please sign in to comment.