Skip to content

Commit

Permalink
Use an environment variable for the build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Dec 12, 2024
1 parent d36ddf8 commit 1b288f8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]

env:
BMI_VERSION: 1_2
BUILD_DIR: _build

jobs:
build-on-unix:
Expand Down Expand Up @@ -38,15 +39,15 @@ jobs:
fortran-compiler
- name: Configure project
run: cmake -B _build -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release
run: cmake -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release

- name: Build and install
run: cmake --build _build --target install --config Release
run: cmake --build ${{ env.BUILD_DIR }} --target install --config Release

- name: Test
run: |
test -h $CONDA_PREFIX/lib/libbmigiplf${{ env.SHLIB_EXT }}
ctest --test-dir _build
ctest --test-dir ${{ env.BUILD_DIR }}
build-on-windows:

Expand Down Expand Up @@ -79,12 +80,12 @@ jobs:
- name: Configure, build, and install project
run: |
cmake -B _build -G Ninja -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
cmake --build _build --target install --config Release
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
cmake --build ${{ env.BUILD_DIR }} --target install --config Release
- name: Test
run: |
if ( -not ( Test-Path -Path ${{ env.LIBRARY_PREFIX }}\bin\run_bmigipl_model.exe ) ){ exit 1 }
if ( -not ( Test-Path -Path ${{ env.LIBRARY_PREFIX }}\lib\bmigiplf.lib ) ){ exit 1 }
if ( -not ( Test-Path -Path ${{ env.LIBRARY_PREFIX }}\include\bmigiplf.mod ) ){ exit 1 }
ctest --test-dir _build
ctest --test-dir ${{ env.BUILD_DIR }}

0 comments on commit 1b288f8

Please sign in to comment.