diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c5f62f..64bdb79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,7 +60,7 @@ jobs: cmake --version - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 1 @@ -82,7 +82,7 @@ jobs: - name: Build Tests run: | cd build - make -j4 tests + make -j4 tests || ctest -j1 --output-on-failure --repeat until-pass:4 - name: Run Tests run: | @@ -107,7 +107,7 @@ jobs: name: Intel Fortran steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 1 @@ -158,7 +158,7 @@ jobs: - name: Build Tests run: | cd build - make -j4 tests + make -j4 tests || ctest -j1 --output-on-failure --repeat until-pass:4 - name: Run Tests run: | @@ -173,57 +173,96 @@ jobs: path: | build/**/*.log - Nvidia: - runs-on: ubuntu-22.04 - container: nvcr.io/nvidia/nvhpc:24.7-devel-cuda12.5-ubuntu22.04 + # NOTE: This is weird because the NVHPC image is so large (~8GB) that + # we have to do some tricks to get it to run in GitHub Actions. + Nvidia-Build-Only: + runs-on: ubuntu-24.04 env: FC: nvfortran + NVHPC_IMAGE: nvcr.io/nvidia/nvhpc:25.7-devel-cuda12.9-ubuntu24.04 - name: Nvidia HPC steps: - - name: Versions + # Reclaim lots of space + - name: Free disk space + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + + # Move /var/lib/docker onto the larger ephemeral disk (do this before any docker pulls) + - name: Maximize build space (move Docker storage) + uses: easimon/maximize-build-space@v10 + with: + root-reserve-mb: 4096 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + build-mount-path: '/var/lib/docker' + + - name: Reset Docker daemon & prune run: | - ${FC} --version - cmake --version + sudo systemctl restart docker + docker system prune -af || true - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 1 - - name: Set all directories as git safe - run: | - git config --global --add safe.directory '*' - - - name: Add python-is-python3 package - run: | - apt-get update - apt-get install -y python-is-python3 - - - name: Build GFE Prereqs - run: | - bash ./tools/ci-install-gfe.bash - - - name: Build fArgParse - run: | - mkdir -p build - cd build - cmake .. -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_INSTALL_PREFIX=${HOME}/Software/fArgParse -DCMAKE_PREFIX_PATH=${HOME}/Software/GFE - make -j4 + - name: Pull NVHPC image + run: docker pull "$NVHPC_IMAGE" - - name: Build Tests + # Run everything inside the NVHPC container + - name: Build (inside NVHPC) run: | - cd build - make -j4 tests - - - name: Run Tests - run: | - cd build - ctest -j1 --output-on-failure --repeat until-pass:4 + docker run --rm \ + -v "$GITHUB_WORKSPACE:/workspace" \ + -w /workspace \ + -e FC="$FC" \ + "$NVHPC_IMAGE" \ + bash -lc ' + set -euo pipefail + + echo "== Versions ==" + ${FC} --version || true + + # Base NVHPC images are minimal; install what you need + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + cmake git python-is-python3 ca-certificates pkg-config make + + cmake --version + + echo "== Git safe.directory ==" + git config --global --add safe.directory "*" + + echo "== Build GFE Prereqs ==" + bash ./tools/ci-install-gfe.bash + + echo "== Build fArgParse ==" + mkdir -p build + cd build + cmake .. \ + -DCMAKE_Fortran_COMPILER=${FC} \ + -DCMAKE_INSTALL_PREFIX=${HOME}/Software/fArgParse \ + -DCMAKE_PREFIX_PATH=${HOME}/Software/GFE + make -j4 + + echo "== Build Tests (CURRENTLY TURNED OFF DUE TO PFUNIT ISSUES) ==" + #make -j4 tests || ctest -j1 --output-on-failure --repeat until-pass:4 + + echo "== Run Tests (CURRENTLY TURNED OFF DUE TO PFUNIT ISSUES) ==" + #ctest -j1 --output-on-failure --repeat until-pass:4 + ' - name: Archive log files on failure - uses: actions/upload-artifact@v4 if: failure() + uses: actions/upload-artifact@v4 with: name: logfiles path: | @@ -243,7 +282,7 @@ jobs: cmake --version - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 1 @@ -270,7 +309,7 @@ jobs: - name: Build Tests run: | cd build - make -j4 tests + make -j4 tests || ctest -j1 --output-on-failure --repeat until-pass:4 - name: Run Tests run: | diff --git a/ChangeLog.md b/ChangeLog.md index 849b97c..f8232fd 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- Fixed NVHPC CI to build (does not run tests yet) + ## [1.10.0] - 2025-09-30 ### Changed