Skip to content
This repository was archived by the owner on Aug 19, 2026. It is now read-only.

figr: IGR-only miniapp cleanup and feature port #30

figr: IGR-only miniapp cleanup and feature port

figr: IGR-only miniapp cleanup and feature port #30

Workflow file for this run

name: 'Test Suite'
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: ${{ github.event_name != 'push' }}
jobs:
github:
name: ${{ matrix.nvhpc && format('NVHPC {0} ({1})', matrix.nvhpc, matrix.target) || format('Github ({0}, {1}, intel={2})', matrix.os, matrix.debug, matrix.intel) }}
if: >-
!cancelled()
strategy:
matrix:
os: ['ubuntu', 'macos']
precision: ['']
debug: ['reldebug', 'no-debug']
intel: [true, false]
nvhpc: ['']
target: ['']
exclude:
- os: macos
intel: true
include:
# NVHPC compiler matrix: cpu (build+test), gpu (build-only, acc then omp)
- { nvhpc: '23.11', target: cpu }
- { nvhpc: '23.11', target: gpu }
- { nvhpc: '24.7', target: cpu }
- { nvhpc: '24.7', target: gpu }
- { nvhpc: '24.11', target: cpu }
- { nvhpc: '24.11', target: gpu }
- { nvhpc: '25.9', target: cpu }
- { nvhpc: '25.9', target: gpu }
fail-fast: false
continue-on-error: true
runs-on: ${{ matrix.nvhpc && 'ubuntu-22.04' || format('{0}-latest', matrix.os) }}
env:
NVHPC_IMAGE: ${{ matrix.nvhpc && format('nvcr.io/nvidia/nvhpc:{0}-devel-cuda_multi-ubuntu22.04', matrix.nvhpc) || '' }}
steps:
# ── NVHPC: free disk before pulling the ~25-30 GB cuda_multi image ──
- name: Free disk space
if: matrix.nvhpc
run: |
echo "=== Disk before cleanup ==="
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android \
/opt/ghc /usr/local/share/boost /opt/hostedtoolcache \
/usr/local/graalvm /usr/local/.ghcup \
/usr/local/share/chromium /usr/local/lib/node_modules
sudo docker image prune -af
sudo apt-get clean
echo "=== Disk after cleanup ==="
df -h /
- name: Clone
uses: actions/checkout@v4
- name: Fetch main for coverage diff
run: |
git fetch origin main:main --depth=1
git fetch --deepen=200
continue-on-error: true
# ── NVHPC: pull image and start a long-lived container ──────────────
- name: Pull NVHPC container
if: matrix.nvhpc
run: docker pull "$NVHPC_IMAGE"
- name: Start NVHPC container
if: matrix.nvhpc
run: |
docker run -d --name nvhpc \
--security-opt seccomp=unconfined \
-v "${{ github.workspace }}:/workspace" \
-w /workspace \
-e CC=nvc \
-e CXX=nvc++ \
-e FC=nvfortran \
-e OMPI_ALLOW_RUN_AS_ROOT=1 \
-e OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
-e PMIX_MCA_gds=hash \
-e OMPI_MCA_hwloc_base_binding_policy=none \
-e "FFLAGS=-tp=px -Kieee -noswitcherror" \
-e CFLAGS=-tp=px \
-e CXXFLAGS=-tp=px \
"$NVHPC_IMAGE" sleep infinity
- name: Setup NVHPC
if: matrix.nvhpc
run: |
docker exec nvhpc bash -c '
set -e
apt-get update -y
apt-get install -y cmake python3 python3-venv python3-pip \
libfftw3-dev libhdf5-dev hdf5-tools git
git config --global --add safe.directory /workspace
HPCX_DIR=$(dirname "$(find /opt/nvidia/hpc_sdk -path "*/hpcx/hpcx-*/ompi/bin/mpirun" | head -1)")/../..
MPI_LIB=$(mpifort --showme:link | grep -oP "(?<=-L)\S+" | head -1)
cat > /etc/nvhpc-env.sh <<EOF
export LD_LIBRARY_PATH=${MPI_LIB}:${HPCX_DIR}/ucx/lib:${HPCX_DIR}/ucc/lib:\$LD_LIBRARY_PATH
export OMPI_MCA_rmaps_base_oversubscribe=1
EOF
echo "=== NVHPC Environment ==="
nvfortran --version
'
# ── Standard (non-NVHPC) setup ─────────────────────────────────────
- name: Setup MacOS
if: matrix.os == 'macos' && !matrix.nvhpc
run: |
brew update
brew upgrade || true
brew install coreutils python fftw hdf5 gcc@15 boost open-mpi lapack
echo "FC=gfortran-15" >> $GITHUB_ENV
echo "BOOST_INCLUDE=/opt/homebrew/include/" >> $GITHUB_ENV
- name: Setup Ubuntu
if: matrix.os == 'ubuntu' && matrix.intel == false && !matrix.nvhpc
run: |
sudo apt update -y
sudo apt install -y cmake gcc g++ python3 python3-dev hdf5-tools \
libfftw3-dev libhdf5-dev openmpi-bin libopenmpi-dev \
libblas-dev liblapack-dev
- name: Setup Ubuntu (Intel)
if: matrix.os == 'ubuntu' && matrix.intel == true
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mpi intel-oneapi-mpi-devel
printenv | sort > /tmp/env_before
source /opt/intel/oneapi/setvars.sh
printenv | sort > /tmp/env_after
diff /tmp/env_before /tmp/env_after | grep '^>' | sed 's/^> //' >> $GITHUB_ENV
echo "FC=ifx" >> $GITHUB_ENV
echo "CC=icx" >> $GITHUB_ENV
echo "CXX=icpx" >> $GITHUB_ENV
echo "MPIFC=mpiifx" >> $GITHUB_ENV
echo "MPICC=mpiicx" >> $GITHUB_ENV
echo "MPICXX=mpiicpx" >> $GITHUB_ENV
# ── Standard build + test ───────────────────────────────────────────
- name: Build
if: '!matrix.nvhpc'
run: /bin/bash figr.sh test -v --dry-run -j $(nproc) --${{ matrix.debug }} $PRECISION --test-all
env:
PRECISION: ${{ matrix.precision != '' && format('--{0}', matrix.precision) || '' }}
- name: Test
if: '!matrix.nvhpc'
run: |
/bin/bash figr.sh test -v --max-attempts 3 -j $(nproc) $ONLY_CHANGES --test-all $TEST_PCT
env:
TEST_PCT: ${{ matrix.debug == 'reldebug' && '-% 20' || '' }}
ONLY_CHANGES: ${{ github.event_name == 'pull_request' && '--only-changes' || '' }}
# ── NVHPC build + test (via docker exec into long-lived container) ──
- name: Build (NVHPC)
if: matrix.nvhpc && matrix.target == 'cpu'
run: |
docker exec nvhpc bash -c '
source /etc/nvhpc-env.sh
/bin/bash figr.sh test -v --dry-run -j $(nproc) --test-all
'
- name: Build (NVHPC GPU)
if: matrix.nvhpc && matrix.target == 'gpu'
run: |
docker exec nvhpc bash -c '
source /etc/nvhpc-env.sh
/bin/bash figr.sh test -v --dry-run -j 2 --test-all --gpu acc
/bin/bash figr.sh test -v --dry-run -j 2 --test-all --gpu mp
'
- name: Test (NVHPC)
if: matrix.nvhpc && matrix.target == 'cpu'
run: |
docker exec nvhpc bash -c '
source /etc/nvhpc-env.sh
ulimit -s unlimited || ulimit -s 65536 || true
/bin/bash figr.sh test -v --max-attempts 3 -j $(nproc) --test-all
'
# ── Cleanup ─────────────────────────────────────────────────────────
- name: Stop NVHPC container
if: always() && matrix.nvhpc
run: docker rm -f nvhpc || true