Skip to content

Commit

Permalink
Add macos x64 test (#835)
Browse files Browse the repository at this point in the history
* add x64 macos test

* speed up test

* fix

* fix path

* Update CMakeLists.txt

* fix

* use xvfb

* fix

* -tryHidden

* undo debug

* fix
  • Loading branch information
MaxRayskiy authored Dec 28, 2022
1 parent 7f60675 commit 504c849
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-test-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
- ubuntu20-build-test
- ubuntu22-build-test
- fedora35-build-test
- macos-build-test
uses: ./.github/workflows/test-distribution.yml

upload-distributions:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/test-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,42 @@ jobs:
if: ${{ always() && matrix.os == 'fedora:35' }}
working-directory: test_python
run: python3.9 -m pytest -s -v


macos-test:
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{needs.setup.outputs.version_tag}}

- name: Download Distributive
uses: actions/download-artifact@v3
with:
name: Distributives

- name: Install Pkg
run: |
sudo installer -pkg meshlib_x64.pkg -target /
xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt
# [error] NSGL: Failed to find a suitable pixel format
#- name: Run MeshViewer
#if: always()
#run: /Library/Frameworks/MeshLib.framework/Versions/Current/bin/MeshViewer -tryHidden -noEventLoop

- name: Show meshconv help
if: always()
run: /Library/Frameworks/MeshLib.framework/Versions/Current/bin/meshconv --help

- name: Build example
if: always()
working-directory: examples/cmake-example
run: |
mkdir build && \
cd build && \
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ && \
cmake --build . && \
./cmake-example
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ IF(NOT MR_EMSCRIPTEN)
IF(APPLE)
include_directories(${HOMEBREW_PREFIX}/include)
# need to hardcode some path to fix wheel (no option to pass path)
set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/..;@loader_path/../lib;@loader_path/meshlib;${THIRDPARTY_LIB_DIR};${CMAKE_BINARY_DIR}/bin")
set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/..;@loader_path/../lib;@loader_path/../lib/lib;@loader_path/meshlib;${THIRDPARTY_LIB_DIR};${CMAKE_BINARY_DIR}/bin")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
ELSE()
# set platform dependent flags
Expand Down Expand Up @@ -210,4 +210,4 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/meshlib-config.cmake ${CMAKE_CURRENT_B
DESTINATION ${MR_CONFIG_DIR})

set(CPACK_GENERATOR "DRAGNDROP")
include(CPack)
include(CPack)
2 changes: 1 addition & 1 deletion meshlib-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ include(${SELF_DIR}/cmake/MRViewerConfig.cmake)
include(${SELF_DIR}/cmake/MRCommonPluginsConfig.cmake)

if(APPLE)
message("You can install required packages via brew: ' xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/scripts/macos.txt '")
message("You can install required packages via brew: ' xargs brew install < /Library/Frameworks/MeshLib.framework/Versions/Current/requirements/macos.txt '")
endif(APPLE)

0 comments on commit 504c849

Please sign in to comment.