Skip to content

Commit

Permalink
Update Unix CI (#17)
Browse files Browse the repository at this point in the history
* Changes to make compatible with fpm

* Adding fpm support

* Adding clarification that you don't need to pre-install BMI binding if using fpm

* Updating example dir in GitHub workflow

* Tidy

* Review instructions and touch up text

* Remove obsolete scripts directory

* Remove unused code

* Rename file with more helpful name

* Replace miniconda with micromamba

* Update packages for memtest step

---------

Co-authored-by: Sam Harrison <[email protected]>
  • Loading branch information
mdpiper and samharrison7 authored Oct 10, 2023
1 parent 8703d95 commit 73269fd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build/Test
on: [push, pull_request]

jobs:
build-linux-and-macos:
build-test-unix:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository
Expand All @@ -17,33 +17,24 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8"]
build-type: [Release]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
- uses: mamba-org/setup-micromamba@v1
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
channel-priority: true
micromamba-version: latest
environment-name: testing
create-args: >-
cmake
fortran-compiler
bmi-fortran
- name: Show conda installation info
run: |
conda info
conda list
- name: Install build tools and dependencies into env
run: |
conda install -c conda-forge --override-channels fortran-compiler cmake bmi-fortran
conda list
- name: Make cmake build directory
- name: Make CMake build directory
run: cmake -E make_directory build

- name: Configure cmake
- name: Configure CMake
working-directory: ${{ github.workspace }}/build
run: |
cmake $GITHUB_WORKSPACE \
Expand All @@ -62,6 +53,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ github.workspace }}/example
run: |
sudo apt-get update
sudo apt-get install -y valgrind
valgrind \
--tool=memcheck \
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This repository is organized with the following directories:
model through its BMI</dd>
<dt>test</dt>
<dd>Unit tests for the BMI-ed model</dd>
<dt>examples</dt>
<dt>example</dt>
<dd>Examples of controlling the model through its BMI</dd>
<dt>scripts</dt>
<dd>Helper scripts</dd>
Expand All @@ -51,7 +51,7 @@ This example can be built on Linux, macOS, and Windows.

### CMake - Linux and macOS

To build this example from source with cmake,
To build this example from source with CMake,
using the current Fortran BMI version, run

export BMIF_VERSION=2.0
Expand All @@ -63,11 +63,7 @@ where `<path-to-installation>` is the base directory
in which the Fortran BMI bindings have been installed
(`/usr/local` is the default).
When installing into a conda environment,
use the `CONDA_PREFIX` environment variable.

On macOS only, update runtime paths for all executables with

source ../scripts/update_rpaths
use the `$CONDA_PREFIX` environment variable.

Then, to install (on both Linux and macOS):

Expand Down Expand Up @@ -179,11 +175,11 @@ heat directory:

Run the heat model through its BMI with the `run_bmiheatf` program,
which takes a model configuration file
(see the [examples](./examples) directory for a sample)
(see the [example](./example) directory for a sample)
as a required parameter.
If `run_bmiheatf` is in your path, run it with

run_bmiheatf test.cfg
run_bmiheatf test1.cfg

Output from the model is written to the file **bmiheatf.out**
in the current directory.
Expand Down
7 changes: 0 additions & 7 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,3 @@ make_example(get_value_ex)
make_example(set_value_ex)
make_example(conflicting_instances_ex)
make_example(change_diffusivity_ex)

# file(
# COPY ${CMAKE_CURRENT_SOURCE_DIR}/test1.cfg
# DESTINATION ${CMAKE_BINARY_DIR}/example)
# file(
# COPY ${CMAKE_CURRENT_SOURCE_DIR}/test2.cfg
# DESTINATION ${CMAKE_BINARY_DIR}/example)
33 changes: 0 additions & 33 deletions scripts/update_rpaths.sh

This file was deleted.

0 comments on commit 73269fd

Please sign in to comment.