CI #158
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: CI | |
on: | |
# allows us to run workflows manually | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- develop | |
- master | |
push: | |
branches: | |
- develop | |
- master | |
env: | |
MPI_DIR: /usr | |
HDF5_ROOT: /usr | |
OMP_NUM_THREADS: 2 | |
COVERALLS_PARALLEL: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
setup: | |
runs-on: ubuntu-22.04 | |
outputs: | |
matrix: ${{ steps.read-json.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Send JSON matrix contents to job output | |
id: read-json | |
shell: bash | |
run: | | |
echo "matrix<<EOF" >> $GITHUB_OUTPUT | |
cat $GITHUB_WORKSPACE/tools/ci/matrix.json >> $GITHUB_OUTPUT | |
main: | |
runs-on: ubuntu-22.04 | |
needs: setup | |
strategy: | |
matrix: "${{ fromJSON( needs.setup.outputs.matrix ) }}" | |
name: "${{ matrix.job-name }}" | |
env: | |
MPI: ${{ matrix.mpi }} | |
PHDF5: ${{ matrix.mpi }} | |
OMP: ${{ matrix.omp }} | |
DAGMC: ${{ matrix.dagmc }} | |
NCRYSTAL: ${{ matrix.ncrystal }} | |
EVENT: ${{ matrix.event }} | |
VECTFIT: ${{ matrix.vectfit }} | |
LIBMESH: ${{ matrix.libmesh }} | |
NPY_DISABLE_CPU_FEATURES: "AVX512F AVX512_SKX" | |
OPENBLAS_NUM_THREADS: 1 | |
# libfabric complains about fork() as a result of using Python multiprocessing. | |
# We can work around it with RDMAV_FORK_SAFE=1 in libfabric < 1.13 and with | |
# FI_EFA_FORK_SAFE=1 in more recent versions. | |
RDMAV_FORK_SAFE: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore Python cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: py-${{ matrix.python-version }}-(omp=${{ matrix.omp }} | |
mpi=${{ matrix.mpi }} dagmc=${{ matrix.dagmc }} ncrystal=${{ matrix.ncrystal }} | |
libmesh=${{ matrix.libmesh }} event=${{ matrix.event }} | |
vectfit=${{ matrix.vectfit }}) | |
- name: Environment Variables | |
run: | | |
echo "DAGMC_ROOT=$HOME/DAGMC" | |
echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV | |
echo "OPENMC_ENDF_DATA=$HOME/endf-b-vii.1" >> $GITHUB_ENV | |
- name: Apt dependencies | |
shell: bash | |
run: | | |
sudo apt -y update | |
sudo apt install -y libpng-dev \ | |
libnetcdf-dev \ | |
libpnetcdf-dev \ | |
libhdf5-serial-dev \ | |
libeigen3-dev | |
- name: Optional apt dependencies for MPI | |
shell: bash | |
if: ${{ matrix.mpi == 'y' }} | |
run: | | |
sudo apt install -y libhdf5-mpich-dev \ | |
libmpich-dev | |
sudo update-alternatives --set mpi /usr/bin/mpicc.mpich | |
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: Optional apt dependencies for vectfit | |
shell: bash | |
if: ${{ matrix.vectfit == 'y' }} | |
run: sudo apt install -y libblas-dev liblapack-dev | |
- name: Hash dependencies to check caches | |
run: | | |
$GITHUB_WORKSPACE/tools/ci/gha-caches.sh | |
- name: Restore NJOY2016 | |
uses: actions/cache@v4 | |
with: | |
path: ~/NJOY2016 | |
key: NJOY2016-${{ env.NJOY_HASH }} | |
- name: Restore DAGMC | |
if: ${{ matrix.dagmc == 'y' }} | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/DAGMC | |
~/MOAB | |
key: DAGMC-${{ env.DAGMC_HASH }}/MOAB-${{ env.MOAB_HASH }} | |
- name: Restore NCrystal | |
if: ${{ matrix.ncrystal == 'y' }} | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/ncrystal_src | |
~/ncrystal_bld | |
~/ncrystal_inst | |
key: NCrystal-${{ env.NC_HASH }} | |
- name: Restore vectfit | |
if: ${{ matrix.vectfit == 'y' }} | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/pybind11 | |
~/xtl | |
~/xtensor-python | |
~/xtensor-blas | |
~/vectfit | |
key: vectfit-${{ env.VF_HASH }}/pybind-${{ env.PYBIND_HASH }} | |
- name: Restore libmesh | |
if: ${{ matrix.libmesh == 'y' }} | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/LIBMESH | |
key: libmesh-mpi-${{matrix.mpi}}-${{ env.NC_HASH }} | |
- name: install | |
shell: bash | |
run: | | |
$GITHUB_WORKSPACE/tools/ci/gha-install.sh | |
- name: Restore endf-b-vii.1 cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/nndc_hdf5 | |
~/endf-b-vii.1 | |
key: endf-b-vii.1-cache | |
- name: before | |
shell: bash | |
run: $GITHUB_WORKSPACE/tools/ci/gha-before-script.sh | |
- name: test | |
shell: bash | |
run: | | |
CTEST_OUTPUT_ON_FAILURE=1 make test -C $GITHUB_WORKSPACE/build/ | |
$GITHUB_WORKSPACE/tools/ci/gha-script.sh | |
- name: after_success | |
shell: bash | |
run: | | |
cpp-coveralls -i src -i include -e src/external --exclude-pattern "/usr/*" --dump cpp_cov.json | |
coveralls --merge=cpp_cov.json --service=github | |
finish: | |
needs: main | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true |