More systematic compiler flags for CI; separate Conda-style builds #1902
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
defaults: | |
run: | |
# Enable Conda environment by using the login shell: | |
shell: bash -leo pipefail {0} | |
jobs: | |
CI: | |
strategy: | |
fail-fast: false | |
matrix: | |
rte-kernels: [default, accel] | |
fpmodel: [DP, SP] | |
build-type: [Debug, RelWithDebugInfo] | |
# Add Release config? | |
# Exclude RelWithDebugInfo/accel combinations? | |
env: | |
CMAKE_BUILD_PARALLEL_LEVEL: 8 | |
VERBOSE: | |
CTEST_PARALLEL_LEVEL: 8 | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
FC: gfortran-14 | |
runs-on: ubuntu-24.04 # latest? | |
steps: | |
# | |
# Check out repository under $GITHUB_WORKSPACE | |
# | |
- name: Check out code | |
uses: actions/checkout@v4 | |
# | |
# Cache Conda packages | |
# | |
- name: Cache Conda packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/conda_pkgs_dir | |
key: conda-pkgs | |
# | |
# Set up Conda | |
# | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
activate-environment: rte_rrtmgp_test | |
environment-file: environment-noplots.yml | |
python-version: 3.11 | |
auto-activate-base: false | |
conda-remove-defaults: true | |
# Use the cache properly: | |
use-only-tar-bz2: false | |
# | |
# Install dependencies | |
# | |
- name: Install dependencies | |
run: conda install -c conda-forge netcdf-fortran ninja -y | |
# | |
# Add debug flags | |
# | |
- name: Add debug flags | |
if: matrix.build-type == 'Debug' | |
run: echo "FFLAGS=-std=f2008 -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan" >> "$GITHUB_ENV" | |
# | |
# Build libraries, examples, and tests | |
# | |
- name: Build libraries and tests | |
run: | | |
cmake -S . -B build -G "Ninja" \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
-DRTE_ENABLE_SP="$(test '${{ matrix.fpmodel }}' = SP && echo ON || echo OFF)" \ | |
-DKERNEL_MODE=${{ matrix.rte-kernels }} \ | |
-DBUILD_TESTING=ON | |
cmake --build build | |
# | |
# Run examples, tests and checks | |
# | |
- name: Run examples, tests and checks | |
working-directory: build | |
run: ctest |