Skip to content

Set up testing on Linux and macOS #1

Set up testing on Linux and macOS

Set up testing on Linux and macOS #1

Workflow file for this run

name: Test
on: [push, pull_request]
env:
BMI_VERSION: 1_2
BUILD_DIR: _build
jobs:
build-on-unix:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
env:
SHLIB_EXT: ${{ matrix.os == 'ubuntu-latest' && '.so' || '.dylib' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: latest
environment-name: testing
create-args: >-
make
cmake
pkg-config
fortran-compiler
- name: Configure project
run: cmake -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release
- name: Build and install
run: cmake --build ${{ env.BUILD_DIR }} --target install --config Release
- name: Test
run: |
test -h $CONDA_PREFIX/lib/libbmisnowf${{ env.SHLIB_EXT }}
ctest --test-dir ${{ env.BUILD_DIR }}