Skip to content

Commit

Permalink
Add notebook testing on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
michalk8 committed Jul 13, 2022
1 parent 186fd1f commit facc7f5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/notebook_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: notebook tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-and-test:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8']
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Build
run: |
set -xe
python -VV
pip install --upgrade pip
pip install -e '.[test]'
- name: Print versions
run: |
python -VV
python -c "import jax; print('jax', jax.__version__)"
python -c "import jaxlib; print('jaxlib', jaxlib.__version__)"
- name: Run notebook tests
run: |
python -m pytest --nbval docs/notebooks/ --current-env
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
set -xe
python -VV
pip install --upgrade pip setuptools
pip install --upgrade pip
pip install pytest-memray
pip install -e '.[test]'
Expand All @@ -39,12 +39,12 @@ jobs:
- name: Run fast tests
if: ${{ matrix.test_mark == 'fast' }}
run: |
pytest --cov=ott --cov-append --cov-report=xml --cov-report=term-missing --cov-config=setup.cfg --memray -m fast -n auto
python -m pytest --cov=ott --cov-append --cov-report=xml --cov-report=term-missing --cov-config=setup.cfg --memray -m fast -n auto
- name: Run all tests
if: ${{ matrix.test_mark == 'all' }}
run: |
pytest --cov=ott --cov-append --cov-report=xml --cov-report=term-missing --cov-config=setup.cfg --memray
python -m pytest --cov=ott --cov-append --cov-report=xml --cov-report=term-missing --cov-config=setup.cfg --memray
- name: Upload coverage
uses: codecov/codecov-action@v3
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ test =
pytest
pytest-xdist
pytest-cov
nbval
chex
docs =
sphinx>=4.0
Expand Down

0 comments on commit facc7f5

Please sign in to comment.