Skip to content

Commit

Permalink
Build on Windows with bmi-fortran from conda
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Dec 18, 2024
1 parent 32ded39 commit 1cacc3a
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,40 +84,27 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: mamba-org/setup-micromamba@v1
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: latest
environment-name: testing
create-args: >-
cmake
pkg-config
cxx-compiler
fortran-compiler
bmi-fortran
init-shell: >-
powershell
# The Fortran conda compiler doesn't seem to work on Windows in Actions.
# Instead, use the gfortran installed by chocolately. However, we then
# can't use the bmi-fortran package from conda-forge because it's not
# ABI-compatible. So, build bmi-fortran locally, This is a hack
# workaround.
- name: Build the bmi-fortran specification locally
- name: List current environment variables
run: |
curl -o bmi-fortran.zip -L https://github.com/csdms/bmi-fortran/archive/refs/heads/master.zip
unzip bmi-fortran.zip
cd bmi-fortran-master
mkdir build && cd build
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
cmake --build . --target install --config Release
cd ${{ github.workspace }}
- name: Make cmake build directory
run: cmake -E make_directory build

- name: Configure, build, and install
working-directory: ${{ github.workspace }}/build
ls env:
- name: Configure, build, and install project
run: |
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
cmake --build . --target install --config Release
cmake -B ${{ env.BUILD_DIR }} -LA -G Ninja -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
cmake --build ${{ env.BUILD_DIR }} --target install --config Release
- name: Test for installed files
run: |
Expand All @@ -132,4 +119,4 @@ jobs:
- name: Run CTest
working-directory: ${{ github.workspace }}/build
run: ctest -C Release -VV --output-on-failure
run: ctest --test-dir ${{ env.BUILD_DIR }} -C Release -VV --output-on-failure

0 comments on commit 1cacc3a

Please sign in to comment.