Skip to content

Merge pull request #5 from dareg/mf_toolchain #18

Merge pull request #5 from dareg/mf_toolchain

Merge pull request #5 from dareg/mf_toolchain #18

name: FieldAPI_Tests
on: [push, pull_request]
jobs:
CI:
name: CI
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false # try to complete all jobs
matrix:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build_type: [RelWithDebInfo]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install up-to-date CMake
run: pip install cmake
- name: Clone ecbuild
uses: actions/checkout@v3
with:
repository: ecmwf/ecbuild
path: ecbuild
ref: develop
- name: Clone fiat
uses: actions/checkout@v3
with:
repository: ecmwf-ifs/fiat
path: fiat
ref: develop
- name: Build fiat
env:
ecbuild_ROOT: ${{github.workspace}}/ecbuild/bin
working-directory: ${{github.workspace}}/fiat
run: |
cmake -B ${{github.workspace}}/fiat/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF
cmake --build ${{github.workspace}}/fiat/build -- -j
- name: Configure field_api
env:
ecbuild_ROOT: ${{github.workspace}}/ecbuild/bin
fiat_ROOT: ${{github.workspace}}/fiat/build
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DENABLE_ACC=OFF
- name: Build field_api
# Build your program
run: cmake --build ${{github.workspace}}/build -- -j
- name: Test field_api
env:
DEV_ALLOC_SIZE: 1000000
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
run: ctest --output-on-failure