Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,26 @@ jobs:
CTEST_OUTPUT_ON_FAILURE=1 make test -C $GITHUB_WORKSPACE/build/
$GITHUB_WORKSPACE/tools/ci/gha-script.sh

- name: Install OpenMOC for notebook testing
if: github.base_ref == 'master'
shell: bash -l {0}
run: |
cd ~
git clone https://github.com/mit-crpg/openmoc &&
cd openmoc
# OpenMOC has some custom commands that rely on setuptools/distutils
python setup.py install
# install twice to make sure openmoc.py is copied into the installation location
python setup.py install

- name: Execute all Notebooks
if: github.base_ref == 'master'
shell: bash -l {0}
run: |
git clone https://github.com/mit-crpg/openmoc
cd openmoc
pytest -v .test

- name: after_success
shell: bash
run: |
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/ci_openmc-notebooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Test Notebooks

on:
# Allow this workflow to be run manually
workflow_dispatch:
# Run for pull requests to master branch
pull_request:
branches:
- master

jobs:
# Set the job key
test-notebooks:
# Name the job
name: Test Jupyter Notebooks
# Set the type of machine to run on
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2


- name: Install conda environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: jupyter-actions
environment-file: .github/environment.yml
python-version: 3.7

- name: Install OpenMC
shell: bash -l {0}
run: |
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda activate jupyter-actions
conda install -c conda-forge openmc

- name: Cache Cross Sections
id: xs-cache
uses: actions/cache@v3
with:
# use this cache as long as the download script doesn't change
key: xs-cache-${{ hashfiles('.test/download-xs.sh') }}
path: ~/endfb-vii.1-hdf5/*

- name: Download OpenMC Cross Sections
shell: bash -l {0}
if: steps.xs-cache.outputs.cache-hit != 'true'
run: |
./.test/download-xs.sh

- name: Set Environment Variables
shell: bash -l {0}
run: |
echo "OPENMC_CROSS_SECTIONS=$HOME/endfb-vii.1-hdf5/cross_sections.xml" >> $GITHUB_ENV

- name: Install OpenMOC
shell: bash -l {0}
run: |
conda init bash
source ~/.bashrc
conda activate jupyter-actions
cd ~
git clone https://github.com/mit-crpg/openmoc &&
cd openmoc
# OpenMOC has some custom commands that rely on setuptools/distutils
python setup.py install
# install twice to make sure openmoc.py is copied into the installation location
python setup.py install

- name: Execute all Notebooks
shell: bash -l {0}
run: |
conda activate jupyter-actions
pytest -v .test