Skip to content

Merge branch 'develop' into nab_atlas_structures #371

Merge branch 'develop' into nab_atlas_structures

Merge branch 'develop' into nab_atlas_structures #371

Workflow file for this run

name: build

Check failure on line 1 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

Invalid type for `job.strategy`
# Controls when the workflow will run
on:
# Triggers the workflow on push events
push:
branches: [ 'main', 'develop' ]
tags-ignore: [ '**' ]
# Triggers the workflow on pull request events
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Test on ${{ matrix.arch }} ${{ matrix.io_library_flag }} ${{ matrix.prec_flag }} ${{ matrix.build_flags }}
# The type of runner that the job will run on
runs-on: ubuntu-20.04
strategy:
fail-fast: false # false: try to complete all jobs
matrix:
arch: ['gnu/9.4.0'] # Default arch on Github is GNU 9.4.0 for now
io_library_flag: ['', '--with-serialbox'] # Switch between Serialbox and HDF5
prec_flag: ['', '--single-precision'] # Switch single/double precision
build_flags:
- '' # Plain build without any options
- '--with-gpu --with-loki' # Enable Loki and GPU variants
- '--with-gpu --with-loki --with-mpi' # Enable Loki and GPU variants with MPI
pyiface_flag: [''] # Enable the pyiface variant
atlas_flag: ['--with-atlas'] # Variant using Atlas-managed fields
claw_flag: [''] # Flag to enable CLAW-generated variants
python_f2py_flag: [''] # Enable the f2py variant
claw_flag: ['']
ctest_exclude_pattern: ['-scc-hoist-'] # Regex to disable CTest tests
include:
# Add pyiface build configuration for double precision, non-MPI, HDF5 only
- arch: gnu/9.4.0
io_library_flag: ''
prec_flag: ''
gpu_flag: '--with-gpu'
cuda_flag: '--with-cuda'
loki_flag: '--with-loki'
atlas_flag: '--with-atlas'
pyiface_flag: ''
python_f2py_flag: ''
- arch: github/ubuntu/nvhpc/21.9
io_library_flag: '--with-serialbox'
mpi_flag: ''
prec_flag: ''
gpu_flag: '--with-gpu'
cuda_flag: '--with-cuda'
loki_flag: '--with-loki'
atlas_flag: '--with-atlas'
pyiface_flag: ''
python_f2py_flag: ''
# Add pyiface build configuration for HDF5 only
- arch: github/ubuntu/gnu/9.4.0
io_library_flag: ''
mpi_flag: ''
prec_flag: ''
gpu_flag: ''
cuda_flag: ''
loki_flag: ''
atlas_flag: ''
pyiface_flag: '--cloudsc-fortran-pyiface=ON'
python_f2py_flag: '--cloudsc-python-f2py=ON'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Installs required packages
- name: Package installation
run: |
sudo apt-get install libc-dev-bin gfortran-9 gcc-9 g++-9
# Install MPI
- name: Install MPI via Apt
if: contains( matrix.build_flags, 'with-mpi' )
run: sudo apt-get install libopenmpi-dev
# Free up disk space for nvhpc
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
if: contains( matrix.arch, 'nvhpc' )
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
# Install Compiler
- name: Install nvhpc
if: contains( matrix.arch, 'nvhpc' )
env:
nvhpc_version: ${{ matrix.nvhpc_version }}
run: .github/scripts/bootstrap-nvhpc.sh
# Install HDF5
- name: Install HDF5 via Apt
if: ${{ ! contains( matrix.arch, 'nvhpc' ) && ! contains( matrix.io_library_flag, 'with-serialbox' ) }}
run: sudo apt-get install libhdf5-dev
- name: Install HDF5 from source
if: contains( matrix.arch, 'nvhpc' ) && ! contains( matrix.io_library_flag, 'with-serialbox' )
run: |
source arch/github/ubuntu/${{ matrix.arch }}/env.sh
FC=pgf90 .github/scripts/install-hdf5.sh
# Install Boost
- name: Install Boost libraries
if: contains( matrix.io_library_flag, 'with-serialbox' )
run: sudo apt install libboost-filesystem-dev libboost-system-dev
# Check-out dependencies as part of the bundle creation
- name: Bundle create
run: ./cloudsc-bundle create
# Build the targets
- name: Bundle build
run: |
./cloudsc-bundle build --retry-verbose \
--arch=arch/${{ matrix.arch }} ${{ matrix.prec_flag }} \
${{ matrix.mpi_flag }} ${{ matrix.io_library_flag }} ${{ matrix.gpu_flag }} \
${{ matrix.claw_flag}} ${{ matrix.loki_flag }} ${{ matrix.cuda_flag }} \
${{ matrix.atlas_flag }} ${{ matrix.pyiface_flag }} ${{ matrix.python_f2py_flag }}
# Verify targets exist
- name: Verify targets
env:
io_library_flag: ${{ matrix.io_library_flag }}
prec_flag: ${{ matrix.prec_flag }}
gpu_flag: ${{ matrix.gpu_flag }}
cuda_flag: ${{ matrix.cuda_flag }}
loki_flag: ${{ matrix.loki_flag }}
atlas_flag: ${{ matrix.atlas_flag }}
claw_flag: ${{ matrix.claw_flag }}
pyiface_flag: ${{ matrix.pyiface_flag }}
python_f2py_flag: ${{ matrix.python_f2py_flag }}
run: .github/scripts/verify-targets.sh
# Run ctest
- name: Run CTest
if: ${{ matrix.prec_flag == '' }}
working-directory: ./build
run: |
source env.sh
ctest -O ctest.log --output-on-failure -E "${{ matrix.ctest_exclude_pattern }}"
# Upload test output
- name: Archive CTest output
uses: actions/upload-artifact@v3
if: ${{ matrix.prec_flag == '' }}
with:
name: ctest-log
path: build/ctest.log