Skip to content

Bump actions/checkout from 3 to 4 #895

Bump actions/checkout from 3 to 4

Bump actions/checkout from 3 to 4 #895

name: Self-hosted CI
on:
push:
branches-ignore:
- documentation
pull_request:
branches-ignore:
- documentation
defaults:
run:
shell: bash
jobs:
CI:
runs-on:
labels: cscs-ci
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
config-name: [nvidia-gpu-openacc, cce-cpu-icon-production, cce-gpu-openmp]
fpmodel: [DP, SP]
include:
# The tests are not experimental by default:
- experimental: false
- config-name: nvidia-gpu-openacc
enable-gpu: openacc
compiler-modules: "PrgEnv-nvidia nvidia craype-accel-nvidia60 cdt-cuda/21.09 !cray-libsci_acc"
# Generic accelerator flag
# -acc is removed as it should be detected by the configure script
fcflags: "-O3 -Mallocatable=03 -gopt"
- config-name: cce-cpu-icon-production
enable-gpu: no
compiler-modules: "PrgEnv-cray"
# Production flags for Icon model
fcflags: "-hadd_paren -r am -Ktrap=divz,ovf,inv -hflex_mp=intolerant -hfp1 -hnoacc -O1,cache0"
- config-name: cce-gpu-openmp
enable-gpu: openmp
compiler-modules: "PrgEnv-cray craype-accel-nvidia60 cdt-cuda/22.05 cudatoolkit/11.2.0_3.39-2.1__gf93aa1c"
# OpenMP flags from Nichols Romero (Argonne)
# -homp is removed as it should be detected by the configure script
# (in fact, the configure script detects -fopenmp)
fcflags: "-hnoacc -O0"
experimental: true
env:
# Core variables:
FC: ftn
FCFLAGS: ${{ matrix.fcflags }}
# Configure script variables:
LAUNCH_PREFIX: "srun -C gpu -A d56 -p cscsci -t 15:00"
steps:
#
# Checks-out repository under $GITHUB_WORKSPACE
#
- uses: actions/checkout@v4
#
# Finalize build environment
#
- name: Finalize build environment
run: |
# There are significant limitations on what can go into ${GITHUB_ENV},
# therefore, we use ${BASH_ENV} but only when necessary:
BASH_ENV="${GITHUB_WORKSPACE}/.bash"
echo "source '${GITHUB_WORKSPACE}/.github/workflows/module_switcher'" >> "${BASH_ENV}"
echo "switch_for_module daint-gpu ${{ matrix.compiler-modules }} cray-netcdf cray-hdf5" >> "${BASH_ENV}"
# Use custom Python environment:
# The environment can be re-generated as follows:
# module load cray-python
# python3 -m venv /scratch/snx3000/rpincus/rte-rrtmgp-python
# /scratch/snx3000/rpincus/rte-rrtmgp-python/bin/pip3 install --upgrade pip
# /scratch/snx3000/rpincus/rte-rrtmgp-python/bin/pip3 install dask[array] netCDF4 numpy xarray
echo 'PATH="/scratch/snx3000/rpincus/rte-rrtmgp-python/bin:${PATH}"' >> "${BASH_ENV}"
# Make bash run the above on startup:
echo "BASH_ENV=${BASH_ENV}" >> "${GITHUB_ENV}"
# Compiler needs more temporary space than normally available:
tmpdir='${{ github.workspace }}/tmp'
mkdir "${tmpdir}" && echo "TMPDIR=${tmpdir}" >> "${GITHUB_ENV}"
# We use the "non-default products" for the tests
# (see https://support.hpe.com/hpesc/public/docDisplay?docId=a00113984en_us&page=Modify_Linking_Behavior_to_Use_Non-default_Libraries.html):
echo 'LD_LIBRARY_PATH="${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"' >> "${BASH_ENV}"
# SLURM jobs, user home directories and HDF5 file locking are
# incompatible on Daint:
echo 'HDF5_USE_FILE_LOCKING=FALSE' >> "${GITHUB_ENV}"
#
# Configure
#
- name: Configure
run: |
test 'x${{ matrix.fpmodel }}' = xSP && enable_sp=yes || enable_sp=no
./configure \
--disable-silent-rules \
--enable-gpu=${{ matrix.enable-gpu }} \
--enable-single-precision="${enable_sp}" \
--enable-tests \
|| { cat ./config.log; exit 1; }
#
# Build
#
- name: Build
run: make -j8
#
# Check
#
- name: Check
run: |
make -j8 check
find . -name '*.test.log' -print -exec cat {} ';'