Nightly Notebook Execution #643
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Notebook Execution | |
on: | |
schedule: | |
- cron: '0 3 * * *' # run at 2 AM 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@v4 | |
- id: set-matrix | |
run: echo "::set-output name=matrix::$(find notebooks -name "*.ipynb" | jq -cnR '[inputs | select(length>0)]')" | |
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@v4 | |
#- run: | | |
# pip install -r ${${{ matrix.notebooks }}%/*}/requirements.txt | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.8.12 | |
uses: actions/setup-python@v5 ## 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 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 }}" |