Skip to content

Testsuite logging

Testsuite logging #166

Workflow file for this run

# -----------------------------------------------------------------------------
#
# Copyright (c) 2017 Sam Cox, Roberto Sommariva
#
# This file is part of the AtChem2 software package.
#
# This file is covered by the MIT license which can be found in the file
# LICENSE.md at the top level of the AtChem2 distribution.
#
# -----------------------------------------------------------------------------
name: AtChem2-CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Triggers when pushed to the master (either by merging a Pull Request, or direct commit to master)
push:
branches:
- master
# 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:
# The type of runner that the job will run on - we use a matrix to run on two OSs
# runner images are described here: https://github.com/actions/runner-images
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-11, macos-12]
fortran: [9, 10, 11]
fail-fast: false
# 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
with:
fetch-depth: 2
# -------------------------------------------------------------
# Install gfortran - if not supplied on this OS image
# macOS-11 only
- name: Install gfortran-9 on macOS-11
if: matrix.os == 'macos-11' && matrix.fortran == 9
run: brew install gcc@${{ matrix.fortran }}
# macOS-12 only
- name: Install gfortran-9 or gfortran-10 on macOS-12
if: matrix.os == 'macos-12' && (matrix.fortran == 9 || matrix.fortran == 10)
run: brew install gcc@${{ matrix.fortran }}
# -------------------------------------------------------------
# Install cvode
# ubuntu only
- name: Install cvode (ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: ./tools/install/install_cvode.sh $PWD $(which gfortran-${{ matrix.fortran }})
# macOS only
- name: Install cvode (macOS)
if: startsWith(matrix.os, 'macos')
run: ./tools/install/install_cvode.sh $PWD $(which gfortran-${{ matrix.fortran }})
# -------------------------------------------------------------
# Install all other dependencies
# both OSs
- name: Install openlibm
run: ./tools/install/install_openlibm.sh $PWD
- name: Install numdiff
run: ./tools/install/install_numdiff.sh $PWD
- name: Install fruit
run: sudo ./tools/install/install_fruit.sh $PWD
# -------------------------------------------------------------
# Build AtChem2 and run all tests
- name: Build AtChem2
# Set FORT_VERSION for use inside the Makefile (called from build_atchem2.sh)
env:
FORT_VERSION: ${{ matrix.fortran }}
run: |
cp tools/install/Makefile.skel Makefile
./build/build_atchem2.sh ./model/mechanism.fac
if [ $RUNNER_OS != 'Linux' ] ; then
install_name_tool -change libopenlibm.4.dylib $PWD/openlibm-0.8.1/libopenlibm.4.dylib atchem2 ;
install_name_tool -change @rpath/libsundials_cvode.2.dylib $PWD/cvode/lib/libsundials_cvode.dylib atchem2 ;
install_name_tool -change @rpath/libsundials_fnvecserial.2.dylib $PWD/cvode/lib/libsundials_fnvecserial.dylib atchem2 ;
install_name_tool -change @rpath/libsundials_nvecserial.2.dylib $PWD/cvode/lib/libsundials_nvecserial.dylib atchem2 ;
fi
# -------------------------------------------------------------
- name: Indent and style tests
run: |
make indenttest
make styletest
# -------------------------------------------------------------
- name: Run AtChem2
run: |
# Run Atchem2
./atchem2
# Upload 'build' coverage to codecov
if [[ "$RUNNER_OS" == "Linux" ]]; then sudo ln -f -s /usr/bin/gcov-${{ matrix.fortran }} /usr/bin/gcov ; bash <(curl -s https://codecov.io/bash) -F build ; fi
# -------------------------------------------------------------
- name: Run tests
# Set FORT_VERSION for use inside the Makefile
env:
FORT_VERSION: ${{ matrix.fortran }}
run: |
# Run unit tests
export PATH=$PATH:$PWD/numdiff/bin
make unittests
# Upload 'unittests' coverage to codecov
if [[ "$RUNNER_OS" == "Linux" ]]; then sudo ln -f -s /usr/bin/gcov-${{ matrix.fortran }} /usr/bin/gcov ; bash <(curl -s https://codecov.io/bash) -F unittests ; fi
make clean
# Run full build tests - this will upload 'tests' coverage to codecov for each test
make oldtests
make modeltests