Continuous Integration #1674
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 | |
- develop | |
pull_request: | |
branches-ignore: | |
- documentation | |
workflow_dispatch: | |
defaults: | |
run: | |
# Enable Conda environment by using the login shell: | |
shell: bash -leo pipefail {0} | |
jobs: | |
CI: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
fortran-compiler: [gfortran-12, gfortran-13, gfortran-14] | |
fpmodel: [DP, SP] | |
env: | |
# Core variables: | |
FC: ${{ matrix.fortran-compiler }} | |
FCFLAGS: "-ffree-line-length-none -m64 -std=f2008 -march=native -fbounds-check -fmodule-private -fimplicit-none -finit-real=nan -g -DRTE_USE_CBOOL -DRTE_USE_${{ matrix.fpmodel }}" | |
# Make variables: | |
FCINCLUDE: -I/usr/include | |
RRTMGP_ROOT: ${{ github.workspace }} | |
RRTMGP_DATA: ${{ github.workspace }}/rrtmgp-data | |
RUN_CMD: | |
FAILURE_THRESHOLD: 7.e-4 | |
steps: | |
# | |
# Relax failure thresholds for single precision | |
# | |
- name: Relax failure threshold for single precision | |
if: matrix.fpmodel == 'SP' | |
run: echo "FAILURE_THRESHOLD=3.5e-1" >> $GITHUB_ENV | |
# | |
# Check out repository under $GITHUB_WORKSPACE | |
# | |
- name: Check out code | |
uses: actions/checkout@v4 | |
# | |
# Check out data | |
# | |
- name: Check out data | |
uses: actions/checkout@v4 | |
with: | |
repository: earth-system-radiation/rrtmgp-data | |
path: rrtmgp-data | |
ref: v1.8.2 | |
# | |
# Synchronize the package index | |
# | |
- name: Synchronize the package index | |
run: sudo apt-get update | |
# | |
# Install NetCDF-Fortran (compatible with all compilers) | |
# | |
- name: Install NetCDF-Fortran | |
run: sudo apt-get install libnetcdff-dev | |
# | |
# 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 | |
# Use the cache properly: | |
use-only-tar-bz2: true | |
# | |
# Build libraries, examples and tests | |
# | |
- name: Build libraries | |
run: | | |
$FC --version | |
make -j4 libs | |
# | |
# Run examples and tests | |
# | |
- name: Build and run examples and tests | |
run: make -j4 tests | |
# | |
# Compare the results | |
# | |
- name: Compare the results | |
run: make -j4 check |