Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows to CI testing #11

Merged
merged 8 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,43 @@ jobs:
run: |
test -h $CONDA_PREFIX/lib/libbmigiplf${{ env.SHLIB_EXT }}
ctest

build-on-windows:

if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository

runs-on: windows-latest

env:
LIBRARY_PREFIX: $env:CONDA_PREFIX\Library

steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: latest
environment-name: testing
create-args: >-
cmake
cxx-compiler
init-shell: >-
powershell

- name: Make cmake build directory
run: cmake -E make_directory build

- name: Configure, build, and install
working-directory: ${{ github.workspace }}/build
run: |
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="${{ env.LIBRARY_PREFIX }}" -DCMAKE_BUILD_TYPE=Release
cmake --build . --target install --config Release

- name: Test
working-directory: ${{ github.workspace }}/build
run: |
if ( -not ( Test-Path -Path ${{ env.LIBRARY_PREFIX }}\lib\libbmigiplf.dll.a ) ){ exit 1 }
if ( -not ( Test-Path -Path ${{ env.LIBRARY_PREFIX }}\bin\libbmigiplf.dll ) ){ exit 1 }
ctest
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.12)

# set fortran compiler
# set(CMAKE_Fortran_COMPILER gfortran-mp-9)
#set(CMAKE_Fortran_FLAGS --std=legacy)

project(bmigipl Fortran)

include(GNUInstallDirs)

set(bmi_version 1.0)
set(bmigipl_lib bmigiplf)
set(data_dir ${CMAKE_SOURCE_DIR}/data)
Expand Down
21 changes: 12 additions & 9 deletions GIPL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ add_executable(run_bmi${pkg_name} bmi_main.f90)
target_link_libraries(run_bmi${pkg_name} ${bmigipl_lib})

install(
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/run_${pkg_name}
DESTINATION bin
COMPONENT ${pkg_name})
TARGETS run_${pkg_name}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/run_bmi${pkg_name}
DESTINATION bin
COMPONENT ${pkg_name})
TARGETS run_bmi${pkg_name}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
TARGETS ${bmigipl_lib}
DESTINATION lib
COMPONENT ${pkg_name})
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/${mod_name}.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/${bmigipl_lib}.mod
DESTINATION include)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
Loading