Skip to content

Commit

Permalink
test example in CI (new) (#579)
Browse files Browse the repository at this point in the history
* test example CI

* try to correct path

* update

* update test

* add to tox

* rename

* fix tox

* add to tox

* update

* update path

* add kernel

* fix deps

* readd deps

* add env

* update

* update ci

* add submodules

* add recursive

* change command to build the docs

* new name just to test CI

* specify kernel

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove display name

* rename kernel

* fix tox env

* use jupytext

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* print notebook name

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Arina Danilina <[email protected]>
Co-authored-by: giovp <[email protected]>
Co-authored-by: Giovanni Palla <[email protected]>
Co-authored-by: Dominik Klein <[email protected]>
Co-authored-by: selmanozleyen <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Selman Özleyen <[email protected]>
  • Loading branch information
8 people authored Mar 26, 2024
1 parent a5187c0 commit d79c18c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test examples

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

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ["3.10"]

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test examples
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
tox -e examples-docs
17 changes: 16 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ commands =
[testenv:lint-docs]
description = Lint the documentation.
deps =
extras = docs
ignore_errors = true
allowlist_externals = make
Expand All @@ -294,6 +293,22 @@ commands =
# TODO(michalk8): uncomment after https://github.com/theislab/moscot/issues/490
# make spelling {posargs}
[testenv:examples-docs]
allowlist_externals = bash
description = Run the notebooks.
use_develop = true
deps =
ipykernel
jupytext
nbconvert
leidenalg
extras = docs
changedir = {tox_root}{/}docs
commands =
python -m ipykernel install --user --name=moscot
bash -c "for nb in notebooks/examples/plotting/*.ipynb notebooks/examples/problems/*ipynb notebooks/examples/solvers/*ipynb; do echo Running $nb; jupytext -k moscot --execute $nb; done"
[testenv:clean-docs]
description = Remove the documentation.
deps =
Expand Down

0 comments on commit d79c18c

Please sign in to comment.