Skip to content

Commit

Permalink
GHA: re-enable Windows builds/tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny authored Jun 17, 2024
2 parents 96a3a2e + 7a25c85 commit e1336b8
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 59 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/buildThirdPartyLibrary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
fail-fast: false
matrix:
include:
# - name: 'Windows release'
# os: windows-latest
# build_type: Release
# - name: 'Windows debug'
# os: windows-latest
# build_type: Debug
- name: 'Windows release'
os: windows-latest
build_type: Release
- name: 'Windows debug'
os: windows-latest
build_type: Debug
- name: 'Linux'
os: ubuntu-20.04
# Note: we must use ubuntu-20.04 rather than ubuntu-latest (i.e. ubuntu-22.04 at this stage). Indeed,
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
fail-fast: false
matrix:
include:
# - name: 'Windows static library'
# os: windows-latest
# shared_libs: OFF
# - name: 'Windows shared library'
# os: windows-latest
# shared_libs: ON
- name: 'Windows static library'
os: windows-latest
shared_libs: OFF
- name: 'Windows shared library'
os: windows-latest
shared_libs: ON
- name: 'Linux static library'
os: ubuntu-latest
shared_libs: OFF
Expand Down Expand Up @@ -87,8 +87,8 @@ jobs:
fail-fast: false
matrix:
include:
# - name: 'Windows Python wheels'
# os: windows-latest
- name: 'Windows Python wheels'
os: windows-latest
- name: 'Linux Python wheels'
os: ubuntu-latest
- name: 'macOS Python wheels (Intel)'
Expand Down
90 changes: 45 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@ jobs:
fail-fast: false
matrix:
include:
# - name: 'Windows static library'
# os: windows-latest
# build_type: Release
# code_analysis: OFF
# code_coverage: OFF
# documentation: OFF
# javascript_bindings: OFF
# javascript_unit_testing: OFF
# memory_checks: OFF
# python_bindings: OFF
# python_unit_testing: OFF
# shared_libs: OFF
# unit_testing: ON
# target: unit_testing
# install_uninstall_and_package: ON
# - name: 'Windows shared library'
# os: windows-latest
# build_type: Release
# code_analysis: OFF
# code_coverage: OFF
# documentation: OFF
# javascript_bindings: OFF
# javascript_unit_testing: OFF
# memory_checks: OFF
# python_bindings: OFF
# python_unit_testing: OFF
# shared_libs: ON
# unit_testing: ON
# target: unit_testing
# install_uninstall_and_package: ON
- name: 'Windows static library'
os: windows-latest
build_type: Release
code_analysis: OFF
code_coverage: OFF
documentation: OFF
javascript_bindings: OFF
javascript_unit_testing: OFF
memory_checks: OFF
python_bindings: OFF
python_unit_testing: OFF
shared_libs: OFF
unit_testing: ON
target: unit_testing
install_uninstall_and_package: ON
- name: 'Windows shared library'
os: windows-latest
build_type: Release
code_analysis: OFF
code_coverage: OFF
documentation: OFF
javascript_bindings: OFF
javascript_unit_testing: OFF
memory_checks: OFF
python_bindings: OFF
python_unit_testing: OFF
shared_libs: ON
unit_testing: ON
target: unit_testing
install_uninstall_and_package: ON
- name: 'Linux static library'
os: ubuntu-latest
build_type: Release
Expand Down Expand Up @@ -147,21 +147,21 @@ jobs:
shared_libs: OFF
unit_testing: OFF
target: javascript_unit_testing
# - name: 'Windows Python bindings'
# os: windows-latest
# build_type: Release
# code_analysis: OFF
# code_coverage: OFF
# documentation: OFF
# javascript_bindings: OFF
# javascript_unit_testing: OFF
# memory_checks: OFF
# python_bindings: ON
# python_unit_testing: ON
# shared_libs: OFF
# unit_testing: OFF
# target: python_unit_testing
# pip_install_test_and_uninstall: ON
- name: 'Windows Python bindings'
os: windows-latest
build_type: Release
code_analysis: OFF
code_coverage: OFF
documentation: OFF
javascript_bindings: OFF
javascript_unit_testing: OFF
memory_checks: OFF
python_bindings: ON
python_unit_testing: ON
shared_libs: OFF
unit_testing: OFF
target: python_unit_testing
pip_install_test_and_uninstall: ON
- name: 'Linux Python bindings'
os: ubuntu-latest
build_type: Release
Expand Down
14 changes: 14 additions & 0 deletions src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ if(LIBOPENCOR_PYTHON_BINDINGS)
target_link_libraries(${PYTHON_BINDINGS_TARGET} PRIVATE
$<TARGET_NAME:${CMAKE_PROJECT_NAME}>)

if($ENV{GITHUB_ACTIONS} AND WIN32 AND SKBUILD)
# Note: this is to account for the fact that the `pip install libOpenCOR` step in our CI doesn't, on GitHub
# Actions' Windows runner, generate the library in the correct place while it used to be fine before (see
# https://github.com/actions/runner-images/issues/10004). Normally, we would expect the library to be
# created in _skbuild/win-amd64-3.12/cmake-build/src/bindings/python/Release/libopencor but for some
# reasons it is created in _skbuild/win-amd64-3.12/cmake-build/src/bindings/python/Release. So, we need to
# copy it to the correct place otherwise its installation will fail (besides the fact that we want to copy
# it to our test directory so that we can test things properly).

add_custom_command(TARGET ${PYTHON_BINDINGS_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE_DIR:${PYTHON_BINDINGS_TARGET}>/../$<TARGET_FILE_NAME:${PYTHON_BINDINGS_TARGET}>
$<TARGET_FILE:${PYTHON_BINDINGS_TARGET}>)
endif()

add_custom_command(TARGET ${PYTHON_BINDINGS_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PYTHON_BINDINGS_TARGET}>
${PYTHON_BINDINGS_DIR}/${CMAKE_PROJECT_NAME_LC}/$<TARGET_FILE_NAME:${PYTHON_BINDINGS_TARGET}>)
Expand Down

0 comments on commit e1336b8

Please sign in to comment.