Skip to content

Commit 1cacc3a

Browse files
committed
Build on Windows with bmi-fortran from conda
1 parent 32ded39 commit 1cacc3a

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,40 +84,27 @@ jobs:
8484
steps:
8585
- uses: actions/checkout@v4
8686
- uses: ilammy/msvc-dev-cmd@v1
87-
- uses: mamba-org/setup-micromamba@v1
87+
- uses: mamba-org/setup-micromamba@v2
8888
with:
8989
micromamba-version: latest
9090
environment-name: testing
9191
create-args: >-
9292
cmake
9393
pkg-config
9494
cxx-compiler
95+
fortran-compiler
96+
bmi-fortran
9597
init-shell: >-
9698
powershell
9799
98-
# The Fortran conda compiler doesn't seem to work on Windows in Actions.
99-
# Instead, use the gfortran installed by chocolately. However, we then
100-
# can't use the bmi-fortran package from conda-forge because it's not
101-
# ABI-compatible. So, build bmi-fortran locally, This is a hack
102-
# workaround.
103-
- name: Build the bmi-fortran specification locally
100+
- name: List current environment variables
104101
run: |
105-
curl -o bmi-fortran.zip -L https://github.com/csdms/bmi-fortran/archive/refs/heads/master.zip
106-
unzip bmi-fortran.zip
107-
cd bmi-fortran-master
108-
mkdir build && cd build
109-
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
110-
cmake --build . --target install --config Release
111-
cd ${{ github.workspace }}
112-
113-
- name: Make cmake build directory
114-
run: cmake -E make_directory build
115-
116-
- name: Configure, build, and install
117-
working-directory: ${{ github.workspace }}/build
102+
ls env:
103+
104+
- name: Configure, build, and install project
118105
run: |
119-
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
120-
cmake --build . --target install --config Release
106+
cmake -B ${{ env.BUILD_DIR }} -LA -G Ninja -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
107+
cmake --build ${{ env.BUILD_DIR }} --target install --config Release
121108
122109
- name: Test for installed files
123110
run: |
@@ -132,4 +119,4 @@ jobs:
132119
133120
- name: Run CTest
134121
working-directory: ${{ github.workspace }}/build
135-
run: ctest -C Release -VV --output-on-failure
122+
run: ctest --test-dir ${{ env.BUILD_DIR }} -C Release -VV --output-on-failure

0 commit comments

Comments
 (0)