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
101 changes: 85 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,93 @@ jobs:
sudo update-alternatives --set mpirun /usr/bin/mpirun.mpich
sudo update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich

- name: cache-xs
uses: actions/cache@v6
with:
path: |
~/nndc_hdf5
~/endf-b-vii.1
key: ${{ runner.os }}-build-xs-cache-${{ hashFiles('tools/ci/download-xs.sh') }}

- name: get cache keys from commits, scripts, and mpi-dep versions
shell: bash
run: $GITHUB_WORKSPACE/tools/ci/gha-cache-keys.sh

- name: Restore pip cache according to mpi-deps
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: >-
pip-${{ runner.os }}-
py${{ matrix.python-version }}-
mpi-${{ matrix.mpi }}-
${{ hashFiles(format('tools/ci/requirements-mpi-{0}.txt', matrix.mpi)) }}-
${{ hashFiles('tools/ci/mpi-deps.txt') }}

- name: Restore NJOY2016
id: njoy
uses: actions/cache@v6
with:
path: |
~/NJOY2016/metaconfigure
~/NJOY2016/build/njoy
~/NJOY2016/build/libnjoy.so
key: >-
NJOY2016-${{ env.NJOY_HASH }}-
${{ runner.os }}-
${{ hashFiles('tools/ci/gha-install-njoy.sh') }}

- name: Restore MOAB
id: moab
if: ${{ matrix.dagmc == 'y' }}
uses: actions/cache@v6
with:
path: |
~/MOAB
key: >-
MOAB-${{ env.MOAB_HASH }}-
${{ runner.os }}-
${{ hashFiles('tools/ci/gha-install-moab.sh') }}

- name: Restore DAGMC
id: dagmc
if: ${{ matrix.dagmc == 'y' }}
uses: actions/cache@v6
with:
path: |
~/DAGMC
key: >-
DAGMC-${{ env.DAGMC_HASH }}-
${{ runner.os }}-
${{ hashFiles('tools/ci/gha-install-dagmc.sh') }}

- name: Restore libmesh
id: libmesh
if: ${{ matrix.libmesh == 'y' }}
uses: actions/cache@v6
with:
path: |
~/LIBMESH
key: >-
libmesh-mpi-${{ matrix.mpi }}-
${{ env.LB_HASH }}-
${{ runner.os }}-
${{ hashFiles('tools/ci/gha-install-libmesh.sh') }}

- name: install
env:
NJOY_HIT: ${{ steps.njoy.outputs.cache-hit }}
MOAB_HIT: ${{ steps.moab.outputs.cache-hit }}
DAGMC_HIT: ${{ steps.dagmc.outputs.cache-hit }}
LIBMESH_HIT: ${{ steps.libmesh.outputs.cache-hit }}
shell: bash
run: |
echo "$HOME/NJOY2016/build" >> $GITHUB_PATH
$GITHUB_WORKSPACE/tools/ci/gha-install.sh

- name: display-config
shell: bash
run: |
openmc -v

- name: cache-xs
uses: actions/cache@v5
with:
path: |
~/nndc_hdf5
~/endf-b-vii.1
key: ${{ runner.os }}-build-xs-cache-${{ hashFiles(format('{0}/tools/ci/download-xs.sh', github.workspace)) }}
run: openmc -v

- name: before
shell: bash
Expand All @@ -174,13 +243,13 @@ jobs:
run: |
CTEST_OUTPUT_ON_FAILURE=1 make test -C $GITHUB_WORKSPACE/build/
$GITHUB_WORKSPACE/tools/ci/gha-script.sh

- name: Setup tmate debug session
continue-on-error: true
if: ${{ failure() && contains(env.COMMIT_MESSAGE, '[gha-debug]') }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 10

- name: Generate C++ coverage (gcovr)
shell: bash
run: |
Expand All @@ -198,13 +267,13 @@ jobs:
--merge-mode-functions=separate \
--print-summary \
--lcov -o coverage-cpp.lcov || true

- name: Merge C++ and Python coverage
shell: bash
run: |
# Merge C++ and Python LCOV into a single file for upload
cat coverage-cpp.lcov coverage-python.lcov > coverage.lcov

- name: Upload coverage to Coveralls
if: ${{ hashFiles('coverage.lcov') != '' }}
uses: coverallsapp/github-action@v2
Expand All @@ -214,7 +283,7 @@ jobs:
flag-name: C++ and Python
path-to-lcov: coverage.lcov
fail-on-error: false

coverage:
needs: [filter-changes, main]
if: ${{ always() }}
Expand All @@ -227,7 +296,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
fail-on-error: false

ci-pass:
needs: [filter-changes, main, coverage]
name: Check CI status
Expand Down
29 changes: 29 additions & 0 deletions tools/ci/gha-cache-keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
set -ex

echo "NJOY_HASH=$(git ls-remote https://github.com/njoy/NJOY2016.git \
--tags 2016.78 )" >> $GITHUB_ENV

if [[ "$DAGMC" == 'y' ]]; then
echo "MOAB_HASH=$(git ls-remote https://bitbucket.org/fathomteam/moab.git \
--tags 5.5.1 )" >> $GITHUB_ENV

echo "DAGMC_HASH=$(git ls-remote https://github.com/svalinn/dagmc.git \
--branches develop )" >> $GITHUB_ENV
fi

if [[ "$LIBMESH" == 'y' ]]; then
echo "LB_HASH=$(git ls-remote https://github.com/libmesh/libmesh \
--tags v1.7.1 )" >> $GITHUB_ENV
fi

if [[ "$MPI" == 'y' ]]; then
dpkg-query -W libmpich-dev libhdf5-mpich-dev > $GITHUB_WORKSPACE/tools/ci/mpi-deps.txt
cat $GITHUB_WORKSPACE/tools/ci/mpi-deps.txt
sha256sum $GITHUB_WORKSPACE/tools/ci/requirements-mpi-y.txt
sha256sum $GITHUB_WORKSPACE/tools/ci/mpi-deps.txt
else
touch $GITHUB_WORKSPACE/tools/ci/mpi-deps.txt
sha256sum $GITHUB_WORKSPACE/tools/ci/requirements-mpi-n.txt
sha256sum $GITHUB_WORKSPACE/tools/ci/mpi-deps.txt
fi
10 changes: 0 additions & 10 deletions tools/ci/gha-install-dagmc.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/bin/bash
set -ex

Expand All @@ -14,15 +13,6 @@ DAGMC_INSTALL_DIR=$HOME/DAGMC/

CURRENT_DIR=$(pwd)

# MOAB Install
cd $HOME
mkdir MOAB && cd MOAB
git clone -b $MOAB_BRANCH $MOAB_REPO
mkdir build && cd build
cmake ../moab -DENABLE_HDF5=ON -DENABLE_NETCDF=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$MOAB_INSTALL_DIR
make -j && make -j install
rm -rf $HOME/MOAB/moab $HOME/MOAB/build

# DAGMC Install
cd $HOME
mkdir DAGMC && cd DAGMC
Expand Down
2 changes: 2 additions & 0 deletions tools/ci/gha-install-libmesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ else
fi
make -j4 install
rm -rf $HOME/LIBMESH/build
rm -rf $HOME/LIBMESH/libmesh
rm -rf $HOME/LIBMESH/examples

popd
20 changes: 20 additions & 0 deletions tools/ci/gha-install-moab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -ex

# MOAB Variables
MOAB_BRANCH='5.5.1'
MOAB_REPO='https://bitbucket.org/fathomteam/moab/'
MOAB_INSTALL_DIR=$HOME/MOAB/

CURRENT_DIR=$(pwd)

# MOAB Install
cd $HOME
mkdir MOAB && cd MOAB
git clone -b $MOAB_BRANCH $MOAB_REPO
mkdir build && cd build
cmake ../moab -DENABLE_HDF5=ON -DENABLE_NETCDF=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$MOAB_INSTALL_DIR
make -j && make -j install
rm -rf $HOME/MOAB/moab $HOME/MOAB/build

cd $CURRENT_DIR
5 changes: 5 additions & 0 deletions tools/ci/gha-install-njoy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ git clone -b 2016.78 https://github.com/njoy/NJOY2016
cd NJOY2016
mkdir build && cd build
cmake -Dstatic=on .. && make 2>/dev/null && sudo make install
find "$HOME/NJOY2016/build" -maxdepth 1 \
! -name njoy \
! -name libnjoy.so \
-type f \
-delete
22 changes: 16 additions & 6 deletions tools/ci/gha-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,38 @@ pip install --upgrade pytest
pip install --upgrade numpy

# Install NJOY 2016
./tools/ci/gha-install-njoy.sh
if [[ "$NJOY_HIT" != "true" ]]; then
./tools/ci/gha-install-njoy.sh
fi

# Install DAGMC if needed
if [[ $DAGMC = 'y' ]]; then
./tools/ci/gha-install-dagmc.sh
if [[ "$DAGMC" == "y" ]]; then
if [[ "$MOAB_HIT" != "true" ]]; then
./tools/ci/gha-install-moab.sh
fi

if [[ "$DAGMC_HIT" != "true" ]]; then
./tools/ci/gha-install-dagmc.sh
fi
fi

# Install NCrystal and verify installation
pip install 'ncrystal>=4.1.0'
nctool --test

# Install libMesh if needed
if [[ $LIBMESH = 'y' ]]; then
./tools/ci/gha-install-libmesh.sh
if [[ "$LIBMESH" == "y" ]]; then
if [[ "$LIBMESH_HIT" != "true" ]]; then
./tools/ci/gha-install-libmesh.sh
fi
fi

# Install MCPL
pip install mcpl

# For MPI configurations, make sure mpi4py and h5py are built against the
# correct version of MPI
if [[ $MPI == 'y' ]]; then
if [[ "$MPI" == "y" ]]; then
pip install --no-binary=mpi4py mpi4py

export CC=mpicc
Expand Down
18 changes: 18 additions & 0 deletions tools/ci/requirements-mpi-n.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# requirements-mpi-n.txt
numpy
h5py
scipy
ipython
matplotlib
pandas
lxml
uncertainties
endf
packaging
pytest
pytest-cov>=4.0
pytest-rerunfailures
colorama
openpyxl
coverage>=7.4
gcovr>=7.2
7 changes: 7 additions & 0 deletions tools/ci/requirements-mpi-y.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# requirements-mpi-y.txt
-r requirements-mpi-n.txt
mpi4py
setuptools
Cython
pkgconfig
h5py
Loading