Update continuous_integration.yml #61
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
# Workflow for continuous integration tests | |
name: Continuous integration gfortran compilers | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
# This workflow contains a single job called "ci_gfortran" | |
ci_gfortran: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: [gfortran-10, gfortran-11] | |
python-version: [3.11] | |
defaults: | |
run: | |
shell: bash -el {0} | |
env: | |
F90: ${{ matrix.compiler }} | |
FC: ${{ matrix.compiler }} | |
F90FLAGS: "-O3 -ffree-line-length-none -fcheck=bounds -finit-real=nan" | |
NFHOME: /usr | |
ATOL: 0.0 | |
RTOL: 0.0 | |
KGO_VERSION: v002 | |
GDKGO1: https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq | |
GDKGO2: https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar | |
GDKGO3: https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2 | |
F90_SHORT_NAME: gfortran | |
# Sequence of tasks that will be executed as part of the job | |
steps: | |
############################################################################### | |
# Initial steps | |
############################################################################### | |
# Checks-out repository under $GITHUB_WORKSPACE | |
- uses: actions/checkout@v4 | |
# Set up conda environment | |
- name: Setup conda environment | |
uses: conda-incubator/[email protected] | |
with: | |
auto-update-conda: true | |
activate-environment: ci-env | |
environment-file: build/environment.yml | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
# NetCDF C and FORTRAN libraries | |
- name: Install NetCDF library | |
run: | | |
sudo apt-get update | |
sudo apt-get install libnetcdff-dev | |
############################################################################### | |
# Build COSP and retrieve input and test files | |
############################################################################### | |
# Build COSP2 driver. | |
- name: Build driver | |
run: | | |
${F90} --version | |
# Retrieve and expand large data files | |
- name: Retrieve KGOs for basic test | |
run: | | |
cd ${GITHUB_WORKSPACE} | |
OUTPATH=driver/data/outputs/cosp2_output_um.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc.gz | |
curl -sSfL -o $OUTPATH $GDKGO1 | |
gunzip ${OUTPATH} | |
cd driver/data/outputs | |
############################################################################### | |
# Run failing test | |
############################################################################### | |
- name: Basic test, UM global snapshot | |
run: | | |
cd driver | |
python test_fail.py | |
############################################################################### | |
# Upload artifact | |
############################################################################### | |
- name: Upload output file if test fails | |
if: failure() | |
uses: actions/[email protected] | |
with: | |
name: cosp2_output_um.${{ matrix.compiler }}.kgo.$KGO_VERSION.nc | |
path: driver/data/outputs/cosp2_output_um.${F90_SHORT_NAME}.kgo.$KGO_VERSION.nc |