Skip to content

Scheduled Notebook Execution #212

Scheduled Notebook Execution

Scheduled Notebook Execution #212

Workflow file for this run

name: Nightly Notebook Execution
on:
schedule:
#- cron: '0 3 * * *' # run at 2 AM UTC
- cron: '0 0 * * 0' # midnight sunday UTC
env:
ARCH_ON_CI: "normal"
IS_CRON: "true"
WEBBPSF_PATH: $HOME/data/webbpsf-data
PYSYN_CDBS: $PWD/grp/redcat/trds/
jobs:
gather-notebooks:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
#run: echo "::set-output name=matrix::$(find notebooks -name "*.ipynb" | jq -cnR '[inputs | select(length>0)]')"
run: echo "matrix=$(find notebooks -name "*.ipynb" | jq -cnR '[inputs | select(length>0)]')" >> $GITHUB_OUTPUT
nightly-notebook-execution:
needs: gather-notebooks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
notebooks: ${{ fromJson(needs.gather-notebooks.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
#- run: |
# pip install -r ${${{ matrix.notebooks }}%/*}/requirements.txt
- uses: actions/checkout@v3
- name: Set up Python 3.8.12
uses: actions/setup-python@v2 ## needed for caching
with:
python-version: 3.8.12
cache: 'pip'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
#conda env update --file CIenvironment.yml --name base
pip install -r pre-requirements.txt
pip install -r requirements.txt
pip install pytest
pip install nbval
pip install nbconvert
- name: Execute notebooks
run: |
jupyter nbconvert --template classic --to html --execute "${{ matrix.notebooks }}"
#- name: Validate notebooks
# run: |
# pytest --nbval "${{ matrix.notebooks }}"