-
Notifications
You must be signed in to change notification settings - Fork 29
85 lines (74 loc) · 2.31 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Test Notebooks
on:
# Allow this workflow to be run manually
workflow_dispatch:
# Run for pull requests
pull_request:
branches:
- main
- develop
# Run every time a new commit is pushed
push:
branches:
- main
- develop
# Run every week on Sunday at midnight
schedule:
- cron: "0 0 * * 1"
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@v2
with:
activate-environment: jupyter-actions
environment-file: .github/environment.yml
python-version: "3.10"
- 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==0.15.0
- 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