Skip to content

Commit

Permalink
Run notebooks once a week in a separate workflow (#263)
Browse files Browse the repository at this point in the history
* Add progress bar

* add description

* new cron job for notebooks

* update other workflows

* remove push

* forgot to remove notebooks in test.yml

* use nbval-lax

* clarify comment in new job

* not sure why tqdm change was here

* undo sanitize change

* ignore nbval warning

* fix warning

Co-authored-by: thuiop <[email protected]>
  • Loading branch information
ismael-mendoza and thuiop committed Feb 25, 2022
1 parent 36e9a71 commit 005665a
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry==1.1.10
pip install poetry==1.1.11
- name: Poetry cache
uses: actions/cache@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: lint

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

jobs:
build:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry==1.1.10
pip install poetry==1.1.11
- name: Poetry cache
uses: actions/cache@v2
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: notebooks

on:
schedule:
- cron: "0 12 * * MON" # run job every Monday at 7.00a EST

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

steps:
- name: Checkout github repo (+ download lfs dependencies)
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry==1.1.11
- name: Create environment variables
run: echo "BTK_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV

- name: Poetry cache
uses: actions/cache@v2
with:
path: |
~/.cache/pypoetry
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('./poetry.lock') }}

# galsim needs this.
- name: Instal FFTW
run: |
sudo apt-get install libfftw3-dev
- name: Install poetry dependencies
run: |
poetry run pip install Cython
poetry install --extras "scarlet"
poetry run pip install git+https://github.com/pmelchior/scarlet
- name: Run notebooks
run: |
poetry run pytest --nbval notebooks --sanitize-with tests/sanitize.cfg --ignore "notebooks/01b-scarlet-measure.ipynb"
8 changes: 2 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: pytest

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

jobs:
build:
Expand Down Expand Up @@ -54,10 +54,6 @@ jobs:
run: |
poetry run pytest --cov=./btk --cov-report=xml --durations=0
- name: Run notebooks
run: |
poetry run pytest --nbval notebooks --sanitize-with tests/sanitize.cfg --ignore "notebooks/01b-scarlet-measure.ipynb"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ filterwarnings = [
"ignore:numpy.ufunc size changed:RuntimeWarning",
"ignore:Creating an ndarray from ragged:numpy.VisibleDeprecationWarning",
"ignore:numpy.ndarray size changed, may indicate binary incompatibility. Expected 80 from C header, got 88 from PyObject:RuntimeWarning:",
"ignore:.*argument to IPyNbFile is deprecated.*:pytest.PytestRemovedIn8Warning",
]
minversion = "6.0"
testpaths = [
Expand Down

0 comments on commit 005665a

Please sign in to comment.