From 9eab1695fafcf82b5434efb633cc0a07a91a9c69 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Wed, 1 Jul 2026 18:29:58 -0500 Subject: [PATCH 01/14] Add cache key script and caching steps for NJOY, MOAB, DAGMC, libmesh --- .github/workflows/ci.yml | 71 +++++++++++++++++++++++++-------- tools/ci/gha-cache-keys.sh | 18 +++++++++ tools/ci/gha-install-libmesh.sh | 2 + tools/ci/gha-install-njoy.sh | 1 + tools/ci/gha-install.sh | 18 ++++++--- 5 files changed, 88 insertions(+), 22 deletions(-) create mode 100755 tools/ci/gha-cache-keys.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3da79c0482..2a9cd710ac8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,9 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} +# cache: 'pip' # caching pip dependencies +# cache-dependency-path: | +# requirements-pip.txt - name: Environment Variables run: | @@ -146,6 +149,51 @@ 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(format('{0}/tools/ci/download-xs.sh', github.workspace)) }} + + - name: Get dependency cache keys + shell: bash + run: $GITHUB_WORKSPACE/tools/ci/gha-cache-keys.sh + + - name: Restore NJOY2016 + uses: actions/cache@v6 + with: + path: | + ~/NJOY2016/metaconfigure + ~/NJOY2016/build/njoy + ~/NJOY2016/build/libnjoy.so + key: NJOY2016-${{ env.NJOY_HASH }} + + - name: Restore MOAB + if: ${{ matrix.dagmc == 'y' }} + uses: actions/cache@v6 + with: + path: | + ~/MOAB + key: MOAB-${{ env.MOAB_HASH }} + + - name: Restore DAGMC + if: ${{ matrix.dagmc == 'y' }} + uses: actions/cache@v6 + with: + path: | + ~/DAGMC + key: DAGMC-${{ env.DAGMC_HASH }} + + - name: Restore libmesh + if: ${{ matrix.libmesh == 'y' }} + uses: actions/cache@v6 + with: + path: | + ~/LIBMESH + key: libmesh-mpi-${{matrix.mpi}}-${{ env.LB_HASH }} + - name: install shell: bash run: | @@ -154,16 +202,7 @@ jobs: - 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 @@ -174,13 +213,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: | @@ -198,13 +237,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 @@ -214,7 +253,7 @@ jobs: flag-name: C++ and Python path-to-lcov: coverage.lcov fail-on-error: false - + coverage: needs: [filter-changes, main] if: ${{ always() }} @@ -227,7 +266,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 diff --git a/tools/ci/gha-cache-keys.sh b/tools/ci/gha-cache-keys.sh new file mode 100755 index 00000000000..724ed562663 --- /dev/null +++ b/tools/ci/gha-cache-keys.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -ex + +echo "NJOY_HASH=$(git ls-remote https://github.com/njoy/NJOY2016.git HEAD \ + --branch 2016.78 | head -c 15)" >> $GITHUB_ENV + +if [[ "$DAGMC" == 'y' ]]; then + echo "MOAB_HASH=$(git ls-remote https://bitbucket.org/fathomteam/moab.git \ + --branch Version5.1.0 HEAD | head -c 15)" >> $GITHUB_ENV + + echo "DAGMC_HASH=$(git ls-remote https://github.com/svalinn/dagmc.git HEAD |\ + head -c 15)" >> $GITHUB_ENV +fi + +if [[ "$LIBMESH" == 'y' ]]; then + echo "LB_HASH=$(git ls-remote https://github.com/libmesh/libmesh \ + --branch v1.7.1 HEAD | head -c 15)" >> $GITHUB_ENV +fi \ No newline at end of file diff --git a/tools/ci/gha-install-libmesh.sh b/tools/ci/gha-install-libmesh.sh index d4557d2d3a2..a6486799bca 100755 --- a/tools/ci/gha-install-libmesh.sh +++ b/tools/ci/gha-install-libmesh.sh @@ -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 diff --git a/tools/ci/gha-install-njoy.sh b/tools/ci/gha-install-njoy.sh index 168fcd4a7b7..071d7ad3a03 100755 --- a/tools/ci/gha-install-njoy.sh +++ b/tools/ci/gha-install-njoy.sh @@ -5,3 +5,4 @@ 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 +rm -rf $HOME/NJOY2016/build \ No newline at end of file diff --git a/tools/ci/gha-install.sh b/tools/ci/gha-install.sh index 4cf62afbb71..e164ad5b663 100755 --- a/tools/ci/gha-install.sh +++ b/tools/ci/gha-install.sh @@ -7,11 +7,15 @@ pip install --upgrade pytest pip install --upgrade numpy # Install NJOY 2016 -./tools/ci/gha-install-njoy.sh +if [[ ! -d "$HOME/NJOY2016" ]]; 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 [[ ! -d "$HOME/DAGMC" ]] || [[ ! -d "$HOME/MOAB" ]]; then + ./tools/ci/gha-install-dagmc.sh + fi fi # Install NCrystal and verify installation @@ -19,8 +23,10 @@ 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 [[ ! -d "$HOME/LIBMESH" ]]; then + ./tools/ci/gha-install-libmesh.sh + fi fi # Install MCPL @@ -28,7 +34,7 @@ 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 From a404973377656a6249437e69977ff9450db93a54 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Thu, 2 Jul 2026 20:26:27 -0500 Subject: [PATCH 02/14] Add pip requirements caching for expensive wheels --- .github/workflows/ci.yml | 6 +++--- tools/ci/requirements.txt | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 tools/ci/requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a9cd710ac8..b80d254d675 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,9 +110,9 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} -# cache: 'pip' # caching pip dependencies -# cache-dependency-path: | -# requirements-pip.txt + cache: 'pip' + cache-dependency-path: | + $GITHUB_WORKSPACE/tools/ci/requirements.txt - name: Environment Variables run: | diff --git a/tools/ci/requirements.txt b/tools/ci/requirements.txt new file mode 100755 index 00000000000..8a53cd39e1d --- /dev/null +++ b/tools/ci/requirements.txt @@ -0,0 +1,18 @@ +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 +mpi4py \ No newline at end of file From f4094ff8fc9a5ad16500f5482d105730492cdef1 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Sat, 4 Jul 2026 16:03:28 -0500 Subject: [PATCH 03/14] Specify pinned versions for NJOY, MOAB, and LIBMESH --- tools/ci/gha-cache-keys.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci/gha-cache-keys.sh b/tools/ci/gha-cache-keys.sh index 724ed562663..97f731ba3b7 100755 --- a/tools/ci/gha-cache-keys.sh +++ b/tools/ci/gha-cache-keys.sh @@ -2,11 +2,11 @@ set -ex echo "NJOY_HASH=$(git ls-remote https://github.com/njoy/NJOY2016.git HEAD \ - --branch 2016.78 | head -c 15)" >> $GITHUB_ENV + --tags 2016.78 | head -c 15)" >> $GITHUB_ENV if [[ "$DAGMC" == 'y' ]]; then echo "MOAB_HASH=$(git ls-remote https://bitbucket.org/fathomteam/moab.git \ - --branch Version5.1.0 HEAD | head -c 15)" >> $GITHUB_ENV + --tags Version5.1.0 | head -c 15)" >> $GITHUB_ENV echo "DAGMC_HASH=$(git ls-remote https://github.com/svalinn/dagmc.git HEAD |\ head -c 15)" >> $GITHUB_ENV @@ -14,5 +14,5 @@ fi if [[ "$LIBMESH" == 'y' ]]; then echo "LB_HASH=$(git ls-remote https://github.com/libmesh/libmesh \ - --branch v1.7.1 HEAD | head -c 15)" >> $GITHUB_ENV + --tags v1.7.1 | head -c 15)" >> $GITHUB_ENV fi \ No newline at end of file From e56a8bea0d7bfb26ba25c90ab860711f66b17eec Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 7 Jul 2026 16:22:38 -0500 Subject: [PATCH 04/14] Split pip cache key depending on mpi-dep version --- .github/workflows/ci.yml | 20 ++++++++++--------- tools/ci/gha-cache-keys.sh | 11 ++++++++++ ...equirements.txt => requirements-mpi-n.txt} | 4 ++-- tools/ci/requirements-mpi-y.txt | 7 +++++++ 4 files changed, 31 insertions(+), 11 deletions(-) rename tools/ci/{requirements.txt => requirements-mpi-n.txt} (81%) create mode 100755 tools/ci/requirements-mpi-y.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b80d254d675..e839ed3644d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,14 +106,6 @@ jobs: with: fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - $GITHUB_WORKSPACE/tools/ci/requirements.txt - - name: Environment Variables run: | echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV @@ -157,10 +149,20 @@ jobs: ~/endf-b-vii.1 key: ${{ runner.os }}-build-xs-cache-${{ hashFiles(format('{0}/tools/ci/download-xs.sh', github.workspace)) }} - - name: Get dependency cache keys + - name: Get dependency cache keys and mpi-dep versions shell: bash run: $GITHUB_WORKSPACE/tools/ci/gha-cache-keys.sh + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: | + $GITHUB_WORKSPACE/tools/ci/mpi-deps.txt + $GITHUB_WORKSPACE/tools/ci/requirements-mpi-${{ matrix.mpi }}.txt + + - name: Restore NJOY2016 uses: actions/cache@v6 with: diff --git a/tools/ci/gha-cache-keys.sh b/tools/ci/gha-cache-keys.sh index 97f731ba3b7..4f696ed0287 100755 --- a/tools/ci/gha-cache-keys.sh +++ b/tools/ci/gha-cache-keys.sh @@ -15,4 +15,15 @@ fi if [[ "$LIBMESH" == 'y' ]]; then echo "LB_HASH=$(git ls-remote https://github.com/libmesh/libmesh \ --tags v1.7.1 | head -c 15)" >> $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 \ No newline at end of file diff --git a/tools/ci/requirements.txt b/tools/ci/requirements-mpi-n.txt similarity index 81% rename from tools/ci/requirements.txt rename to tools/ci/requirements-mpi-n.txt index 8a53cd39e1d..f5aecc94d0c 100755 --- a/tools/ci/requirements.txt +++ b/tools/ci/requirements-mpi-n.txt @@ -1,3 +1,4 @@ +# requirements-mpi-n.txt numpy h5py scipy @@ -14,5 +15,4 @@ pytest-rerunfailures colorama openpyxl coverage>=7.4 -gcovr>=7.2 -mpi4py \ No newline at end of file +gcovr>=7.2 \ No newline at end of file diff --git a/tools/ci/requirements-mpi-y.txt b/tools/ci/requirements-mpi-y.txt new file mode 100755 index 00000000000..e6d0b96750c --- /dev/null +++ b/tools/ci/requirements-mpi-y.txt @@ -0,0 +1,7 @@ +# requirements-mpi-y.txt +-r requirements-mpi-n.txt +mpi4py +setuptools +Cython +pkgconfig +h5py \ No newline at end of file From 563fa0f795640904c3112c03b58ab779289f3a7f Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 7 Jul 2026 18:25:46 -0500 Subject: [PATCH 05/14] Revert to manual pip caching for control over key --- .github/workflows/ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e839ed3644d..3fcec8f380b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,6 +106,11 @@ jobs: with: fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + - name: Environment Variables run: | echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV @@ -153,15 +158,11 @@ jobs: shell: bash run: $GITHUB_WORKSPACE/tools/ci/gha-cache-keys.sh - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Restore pip cache according to mpi-deps + uses: actions/cache@v6 with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: | - $GITHUB_WORKSPACE/tools/ci/mpi-deps.txt - $GITHUB_WORKSPACE/tools/ci/requirements-mpi-${{ matrix.mpi }}.txt - + path: ~/.cache/pip + key: pip-${{ runner.os }}-py${{ matrix.python-version }}-mpi-${{ matrix.mpi }}-${{ hashFiles(format('{0}/tools/ci/requirements*.txt', github.workspace)) }}-${{ hashFiles(format('{0}/tools/ci/mpi-deps.txt', github.workspace)) }} - name: Restore NJOY2016 uses: actions/cache@v6 From bf7468a619cbaf235427c0823b84e57172ab8410 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:46:43 -0500 Subject: [PATCH 06/14] Configure pip key gen to use either requirements-mpi-y/n.txt --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fcec8f380b..4d129df1fad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,8 @@ jobs: uses: actions/cache@v6 with: path: ~/.cache/pip - key: pip-${{ runner.os }}-py${{ matrix.python-version }}-mpi-${{ matrix.mpi }}-${{ hashFiles(format('{0}/tools/ci/requirements*.txt', github.workspace)) }}-${{ hashFiles(format('{0}/tools/ci/mpi-deps.txt', github.workspace)) }} + 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 uses: actions/cache@v6 From cb135cc8b575f30c64f3a7f509d456fb3574d7e5 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 02:50:04 -0500 Subject: [PATCH 07/14] Save njoy and libnjoy.so when clearing NJOY2016/build/ --- tools/ci/gha-install-njoy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/gha-install-njoy.sh b/tools/ci/gha-install-njoy.sh index 071d7ad3a03..faa1098b14c 100755 --- a/tools/ci/gha-install-njoy.sh +++ b/tools/ci/gha-install-njoy.sh @@ -5,4 +5,4 @@ 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 -rm -rf $HOME/NJOY2016/build \ No newline at end of file +rm -v !( "$HOME/NJOY2016/build/njoy"|"$HOME/NJOY2016/build/libnjoy.so" ) \ No newline at end of file From 9e9e10b07e686df64e836b2d5ed70019bb9e8181 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:12:06 -0500 Subject: [PATCH 08/14] Hash install scripts and add os for cache keys, set cache hit variables, edit syntax --- .github/workflows/ci.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d129df1fad..eb7c5f18243 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,9 +152,9 @@ jobs: path: | ~/nndc_hdf5 ~/endf-b-vii.1 - key: ${{ runner.os }}-build-xs-cache-${{ hashFiles(format('{0}/tools/ci/download-xs.sh', github.workspace)) }} + key: ${{ runner.os }}-build-xs-cache-${{ hashFiles('tools/ci/download-xs.sh') }} - - name: Get dependency cache keys and mpi-dep versions + - name: get cache keys from commits, scripts, and mpi-dep versions shell: bash run: $GITHUB_WORKSPACE/tools/ci/gha-cache-keys.sh @@ -164,41 +164,49 @@ jobs: 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 }} + 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 }} + 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 }} + 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 }} + 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 From 263c77cc7d55bb8fab291a3c672a771807997418 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:13:54 -0500 Subject: [PATCH 09/14] Tweak repo commit hash getter script --- tools/ci/gha-cache-keys.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/ci/gha-cache-keys.sh b/tools/ci/gha-cache-keys.sh index 4f696ed0287..dd86411127f 100755 --- a/tools/ci/gha-cache-keys.sh +++ b/tools/ci/gha-cache-keys.sh @@ -1,20 +1,20 @@ #!/bin/bash set -ex -echo "NJOY_HASH=$(git ls-remote https://github.com/njoy/NJOY2016.git HEAD \ - --tags 2016.78 | head -c 15)" >> $GITHUB_ENV +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 Version5.1.0 | head -c 15)" >> $GITHUB_ENV + --tags 5.5.1 )" >> $GITHUB_ENV - echo "DAGMC_HASH=$(git ls-remote https://github.com/svalinn/dagmc.git HEAD |\ - head -c 15)" >> $GITHUB_ENV + echo "DAGMC_HASH=$(git ls-remote https://github.com/svalinn/dagmc.git \ + --head develop )" >> $GITHUB_ENV fi if [[ "$LIBMESH" == 'y' ]]; then echo "LB_HASH=$(git ls-remote https://github.com/libmesh/libmesh \ - --tags v1.7.1 | head -c 15)" >> $GITHUB_ENV + --tags v1.7.1 )" >> $GITHUB_ENV fi if [[ "$MPI" == 'y' ]]; then From 824ddeb2fe4f5c2c10e652fa3086d8fe0c273673 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:14:49 -0500 Subject: [PATCH 10/14] Use cache hit vars for installs and split DAGMC/MOAB install scripts --- tools/ci/gha-install-dagmc.sh | 15 --------------- tools/ci/gha-install-moab.sh | 20 ++++++++++++++++++++ tools/ci/gha-install.sh | 10 +++++++--- 3 files changed, 27 insertions(+), 18 deletions(-) create mode 100755 tools/ci/gha-install-moab.sh diff --git a/tools/ci/gha-install-dagmc.sh b/tools/ci/gha-install-dagmc.sh index 8d0648a5041..64d1f3f4f3b 100755 --- a/tools/ci/gha-install-dagmc.sh +++ b/tools/ci/gha-install-dagmc.sh @@ -1,12 +1,6 @@ - #!/bin/bash set -ex -# MOAB Variables -MOAB_BRANCH='5.5.1' -MOAB_REPO='https://bitbucket.org/fathomteam/moab/' -MOAB_INSTALL_DIR=$HOME/MOAB/ - # DAGMC Variables DAGMC_BRANCH='develop' DAGMC_REPO='https://github.com/svalinn/dagmc' @@ -14,15 +8,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 diff --git a/tools/ci/gha-install-moab.sh b/tools/ci/gha-install-moab.sh new file mode 100755 index 00000000000..0306b51832e --- /dev/null +++ b/tools/ci/gha-install-moab.sh @@ -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 \ No newline at end of file diff --git a/tools/ci/gha-install.sh b/tools/ci/gha-install.sh index e164ad5b663..e48a636068c 100755 --- a/tools/ci/gha-install.sh +++ b/tools/ci/gha-install.sh @@ -7,15 +7,19 @@ pip install --upgrade pytest pip install --upgrade numpy # Install NJOY 2016 -if [[ ! -d "$HOME/NJOY2016" ]]; then +if [[ "$NJOY_HIT" == "true" ]]; then ./tools/ci/gha-install-njoy.sh fi # Install DAGMC if needed if [[ "$DAGMC" == "y" ]]; then - if [[ ! -d "$HOME/DAGMC" ]] || [[ ! -d "$HOME/MOAB" ]]; then + if [[ "$DAGMC_HIT" == "true" ]]; then ./tools/ci/gha-install-dagmc.sh fi + + if [[ "$MOAB_HIT" == "true" ]]; then + ./tools/ci/gha-install-moab.sh + fi fi # Install NCrystal and verify installation @@ -24,7 +28,7 @@ nctool --test # Install libMesh if needed if [[ "$LIBMESH" == "y" ]]; then - if [[ ! -d "$HOME/LIBMESH" ]]; then + if [[ "$LIBMESH_HIT" == "true" ]]; then ./tools/ci/gha-install-libmesh.sh fi fi From 94d14aef3ada94ea01d4da7af6eaa9654779a1ae Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:27:11 -0500 Subject: [PATCH 11/14] Fix missing quotes and make keys easier to read --- .github/workflows/ci.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb7c5f18243..9de726042de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,12 @@ jobs: 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') }} + 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 @@ -172,7 +177,10 @@ jobs: ~/NJOY2016/metaconfigure ~/NJOY2016/build/njoy ~/NJOY2016/build/libnjoy.so - key: NJOY2016-${{ env.NJOY_HASH }}-${{ runner.os }}-${{ hashFiles(tools/ci/gha-install-njoy.sh) }} + key: >- + NJOY2016-${{ env.NJOY_HASH }}- + ${{ runner.os }}- + ${{ hashFiles('tools/ci/gha-install-njoy.sh') }} - name: Restore MOAB id: moab @@ -181,7 +189,10 @@ jobs: with: path: | ~/MOAB - key: MOAB-${{ env.MOAB_HASH }}-${{ runner.os }}-${{ hashFiles(tools/ci/gha-install-moab.sh) }} + key: >- + MOAB-${{ env.MOAB_HASH }}- + ${{ runner.os }}- + ${{ hashFiles('tools/ci/gha-install-moab.sh') }} - name: Restore DAGMC id: dagmc @@ -190,7 +201,10 @@ jobs: with: path: | ~/DAGMC - key: DAGMC-${{ env.DAGMC_HASH }}-${{ runner.os }}-${{ hashFiles(tools/ci/gha-install-dagmc.sh) }} + key: >- + DAGMC-${{ env.DAGMC_HASH }}- + ${{ runner.os }}- + ${{ hashFiles('tools/ci/gha-install-dagmc.sh') }} - name: Restore libmesh id: libmesh @@ -199,7 +213,11 @@ jobs: with: path: | ~/LIBMESH - key: libmesh-mpi-${{ matrix.mpi }}-${{ env.LB_HASH }}-${{ runner.os }}-${{ hashFiles(tools/ci/gha-install-libmesh.sh) }} + key: >- + libmesh-mpi-${{ matrix.mpi }}- + ${{ env.LB_HASH }}- + ${{ runner.os }}- + ${{ hashFiles('tools/ci/gha-install-libmesh.sh') }} - name: install env: From af010f73b39487ac8da8f316a2d17a39844f08f8 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:42:58 -0500 Subject: [PATCH 12/14] Fix inverted == error and replace deprecated --heads in cache key script --- tools/ci/gha-cache-keys.sh | 2 +- tools/ci/gha-install.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ci/gha-cache-keys.sh b/tools/ci/gha-cache-keys.sh index dd86411127f..427824734e1 100755 --- a/tools/ci/gha-cache-keys.sh +++ b/tools/ci/gha-cache-keys.sh @@ -9,7 +9,7 @@ if [[ "$DAGMC" == 'y' ]]; then --tags 5.5.1 )" >> $GITHUB_ENV echo "DAGMC_HASH=$(git ls-remote https://github.com/svalinn/dagmc.git \ - --head develop )" >> $GITHUB_ENV + --branches develop )" >> $GITHUB_ENV fi if [[ "$LIBMESH" == 'y' ]]; then diff --git a/tools/ci/gha-install.sh b/tools/ci/gha-install.sh index e48a636068c..e18d5f3782c 100755 --- a/tools/ci/gha-install.sh +++ b/tools/ci/gha-install.sh @@ -7,17 +7,17 @@ pip install --upgrade pytest pip install --upgrade numpy # Install NJOY 2016 -if [[ "$NJOY_HIT" == "true" ]]; then +if [[ "$NJOY_HIT" != "true" ]]; then ./tools/ci/gha-install-njoy.sh fi # Install DAGMC if needed if [[ "$DAGMC" == "y" ]]; then - if [[ "$DAGMC_HIT" == "true" ]]; then + if [[ "$DAGMC_HIT" != "true" ]]; then ./tools/ci/gha-install-dagmc.sh fi - if [[ "$MOAB_HIT" == "true" ]]; then + if [[ "$MOAB_HIT" != "true" ]]; then ./tools/ci/gha-install-moab.sh fi fi @@ -28,7 +28,7 @@ nctool --test # Install libMesh if needed if [[ "$LIBMESH" == "y" ]]; then - if [[ "$LIBMESH_HIT" == "true" ]]; then + if [[ "$LIBMESH_HIT" != "true" ]]; then ./tools/ci/gha-install-libmesh.sh fi fi From a0e1da52ff3c7744b85f6a2cb8aaba9d36d6e902 Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:48:08 -0500 Subject: [PATCH 13/14] Fix njoy install script error --- tools/ci/gha-install-njoy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ci/gha-install-njoy.sh b/tools/ci/gha-install-njoy.sh index faa1098b14c..f4ad2e83543 100755 --- a/tools/ci/gha-install-njoy.sh +++ b/tools/ci/gha-install-njoy.sh @@ -5,4 +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 -rm -v !( "$HOME/NJOY2016/build/njoy"|"$HOME/NJOY2016/build/libnjoy.so" ) \ No newline at end of file +find "$HOME/NJOY2016/build" -maxdepth 1 \ + ! -name njoy \ + ! -name libnjoy.so \ + -type f \ + -delete \ No newline at end of file From 4d16fa3fc08ff6ac0c157a0e1581392d60d944fc Mon Sep 17 00:00:00 2001 From: John Vincent Cauilan <64677361+johvincau@users.noreply.github.com> Date: Tue, 4 Aug 2026 04:02:58 -0500 Subject: [PATCH 14/14] Install MOAB first before DAGMC --- tools/ci/gha-install-dagmc.sh | 5 +++++ tools/ci/gha-install.sh | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/ci/gha-install-dagmc.sh b/tools/ci/gha-install-dagmc.sh index 64d1f3f4f3b..c0e4cbe8e6e 100755 --- a/tools/ci/gha-install-dagmc.sh +++ b/tools/ci/gha-install-dagmc.sh @@ -1,6 +1,11 @@ #!/bin/bash set -ex +# MOAB Variables +MOAB_BRANCH='5.5.1' +MOAB_REPO='https://bitbucket.org/fathomteam/moab/' +MOAB_INSTALL_DIR=$HOME/MOAB/ + # DAGMC Variables DAGMC_BRANCH='develop' DAGMC_REPO='https://github.com/svalinn/dagmc' diff --git a/tools/ci/gha-install.sh b/tools/ci/gha-install.sh index e18d5f3782c..b3abb36fa21 100755 --- a/tools/ci/gha-install.sh +++ b/tools/ci/gha-install.sh @@ -13,13 +13,13 @@ fi # Install DAGMC if needed if [[ "$DAGMC" == "y" ]]; then - if [[ "$DAGMC_HIT" != "true" ]]; then - ./tools/ci/gha-install-dagmc.sh - fi - 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