Continuous integration in a box #24
Workflow file for this run
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: Continuous integration in a box | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches-ignore: | |
- documentation | |
workflow_dispatch: | |
jobs: | |
Containerized-CI: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, macos-13, windows-2022] | |
toolchain: | |
- {compiler: intel-classic, version: 2021.10} | |
- {compiler: intel, version: 2024.1} | |
- {compiler: nvidia-hpc, version: 23.11} | |
rte-kernels: [default, accel] | |
fpmodel: [DP, SP] | |
exclude: | |
- os: macos-13 | |
toolchain: | |
- {compiler: intel, version: 2024.1} | |
- {compiler: nvidia-hpc, version: 23.11} | |
- os: windows-2022 | |
toolchain: | |
- {compiler: nvidia-hpc, version: 23.11} | |
include: | |
# Flags for Intel Fortran Compiler Classic | |
- toolchain: {compiler: intel-classic, version: 2021.10} | |
rte-kernels: default | |
fcflags: -m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08 -diag-disable=10448 | |
# Flags for Intel Fortran Compiler | |
- toolchain: {compiler: intel, version: 2024.1} | |
rte-kernels: default | |
fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 | |
- toolchain: {compiler: intel, version: 2024.1} | |
rte-kernels: accel | |
fcflags: -debug -traceback -O0 -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08 -fiopenmp -fopenmp-targets=spir64 | |
# Flags for NVIDIA Fortran Compiler | |
- toolchain: {compiler: nvidia-hpc, version: 23.11} | |
rte-kernels: default | |
fcflags: -Mallocatable=03 -Mstandard -Mbounds -Mchkptr -Kieee -Mchkstk | |
- toolchain: {compiler: nvidia-hpc, version: 23.11} | |
rte-kernels: accel | |
fcflags: -Mallocatable=03 -Mstandard -Mbounds -Mchkptr -Kieee -Mchkstk -acc | |
env: | |
RRTMGP_DATA_VERSION: v1.8.2 | |
FAILURE_THRESHOLD: 7.e-4 | |
# https://github.com/earth-system-radiation/rte-rrtmgp/issues/194 | |
OMP_TARGET_OFFLOAD: DISABLED | |
runs-on: ${{ matrix.os }} | |
container: | |
image: ${{ matrix.image }} | |
steps: | |
# | |
# Set up the Fortran environment | |
# | |
- uses: fortran-lang/setup-fortran@v1.6.1 | |
with: | |
compiler: ${{ matrix.toolchain.compiler }} | |
version: ${{ matrix.toolchain.version }} | |
# | |
# Check out repository under $GITHUB_WORKSPACE | |
# | |
- name: Check out code | |
uses: actions/checkout@v4 | |
# | |
# Update Failure threshold if single precision | |
# | |
- name: Failure threshold | |
if: matrix.fpmodel == 'SP' | |
run: echo "FAILURE_THRESHOLD=3.5e-1" >> $GITHUB_ENV | |
# | |
# Install required tools | |
# | |
- name: Install Required Tools | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git cmake libnetcdff-dev | |
# | |
# Build libraries, examples, and tests | |
# | |
- name: Build libraries, examples and tests | |
id: build-success | |
if: ${{ matrix.toolchain.compiler != 'intel' || matrix.rte-kernels != 'accel' }} | |
run: | | |
cmake -S . -B build \ | |
-DCMAKE_Fortran_COMPILER=${{ env.FC }} \ | |
-DCMAKE_Fortran_FLAGS="${{ matrix.fcflags }}" \ | |
-DRRTMGP_DATA_VERSION=${{ env.RRTMGP_DATA_VERSION }} \ | |
-DFP_MODEL=${{ matrix.fpmodel }} \ | |
-DRTE_KERNEL_MODE=${{ matrix.rte-kernels }} \ | |
-DENABLE_TESTS=ON \ | |
-DFAILURE_THRESHOLD=${{ env.FAILURE_THRESHOLD }} | |
cmake --build build --config Release -- -j8 | |
# | |
# Run examples and tests | |
# | |
- name: Run examples and tests | |
if: steps.build-success.outcome != 'skipped' | |
run: | | |
ctest -V --test-dir build | |
# | |
# Generate validation plots | |
# | |
- name: Generate validation plots | |
if: ${{ matrix.toolchain.compiler == 'intel-classic' && matrix.rte-kernels == 'default' && matrix.fpmodel == 'DP' }} | |
run: | | |
cmake --build build --target validation-plots | |
# | |
# Upload validation plots | |
# | |
- name: Upload validation plots | |
if: ${{ matrix.toolchain.compiler == 'intel-classic' && matrix.rte-kernels == 'default' && matrix.fpmodel == 'DP' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: validation-plot | |
path: build/tests/validation-figures.pdf |