Skip to content
Snippets Groups Projects
Commit a06ad170 authored by Schrödter, Tobias's avatar Schrödter, Tobias
Browse files

Merge branch 'macos-ci' into 'master'

Add Macos CI

See merge request !144
parents 33099fe2 4cb93c8d
No related branches found
No related tags found
1 merge request!144Add Macos CI
Pipeline #51062 failed
...@@ -32,7 +32,7 @@ stages: ...@@ -32,7 +32,7 @@ stages:
# from the repository # from the repository
build_container: build_container:
stage: build_environment stage: build_environment
image: image:
name: gcr.io/kaniko-project/executor:debug name: gcr.io/kaniko-project/executor:debug
entrypoint: [""] entrypoint: [""]
script: script:
...@@ -72,9 +72,10 @@ unit_test_linux: ...@@ -72,9 +72,10 @@ unit_test_linux:
artifacts: artifacts:
when: always when: always
paths: paths:
- build/tests/unit_test/unit_test_report.xml - build/tests/unit_test/unit_test_report.xml
reports: reports:
junit: "build/tests/unit_test/unit_test_report.xml" junit: "build/tests/unit_test/unit_test_report.xml"
needs: ["build_linux"]
# Execute regression tests # Execute regression tests
regression_test_linux: regression_test_linux:
...@@ -82,13 +83,14 @@ regression_test_linux: ...@@ -82,13 +83,14 @@ regression_test_linux:
stage: test stage: test
script: script:
- cd tests/regression_test/tests - cd tests/regression_test/tests
- python3 -m pytest --path=../../../build/petrack --junitxml=pytest_report.xml >> "RegressionTestLog.txt" - python3 -m pytest --path=../../../build/petrack --junitxml=pytest_report.xml | tee "RegressionTestLog.txt"
artifacts: artifacts:
when: on_failure when: on_failure
paths: paths:
- "tests/regression_test/tests/RegressionTestLog.txt" - "tests/regression_test/tests/RegressionTestLog.txt"
reports: reports:
junit: "tests/regression_test/tests/pytest_report.xml" junit: "tests/regression_test/tests/pytest_report.xml"
needs: ["build_linux"]
############################################################################### ###############################################################################
...@@ -122,7 +124,7 @@ unit_test_windows: ...@@ -122,7 +124,7 @@ unit_test_windows:
artifacts: artifacts:
when: always when: always
paths: paths:
- build/tests/unit_test/unit_test_report.xml - build/tests/unit_test/unit_test_report.xml
reports: reports:
junit: "build/tests/unit_test/unit_test_report.xml" junit: "build/tests/unit_test/unit_test_report.xml"
needs: ["build_windows"] needs: ["build_windows"]
...@@ -143,7 +145,7 @@ regression_test_windows: ...@@ -143,7 +145,7 @@ regression_test_windows:
junit: "tests/regression_test/tests/pytest_report.xml" junit: "tests/regression_test/tests/pytest_report.xml"
needs: ["build_windows"] needs: ["build_windows"]
build_windows_installer: build_installer_windows:
stage: build_installer stage: build_installer
rules: rules:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
...@@ -163,17 +165,99 @@ build_windows_installer: ...@@ -163,17 +165,99 @@ build_windows_installer:
- "build/petrack-installer-*" - "build/petrack-installer-*"
expire_in: 2hrs expire_in: 2hrs
make_release: make_release_windows:
image: alpine image: alpine
stage: deploy stage: deploy
rules: rules:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
when: never when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
needs: ["build_windows_installer"] needs: ["build_installer_windows"]
script: script:
- apk --no-cache add curl - apk --no-cache add curl
- cd build - cd build
- winInst=$(echo petrack-installer-*) - winInst=$(echo petrack-installer-*)
- curl -k -T $winInst -u "${SCIEBO_TOKEN}:" https://fz-juelich.sciebo.de/public.php/webdav/$winInst - curl -k -T $winInst -u "${SCIEBO_WIN_INSTALLER_PATH}:" https://fz-juelich.sciebo.de/public.php/webdav/$winInst
###############################################################################
# MacOS CI
###############################################################################
# Build petrack and petrack unit_tests
build_macos:
stage: build
tags:
- macos
script:
- mkdir build
- cd build
- cmake -G Ninja .. -DBUILD_BUNDLE=ON -DBUILD_UNIT_TESTS=ON -DCMAKE_PREFIX_PATH=/Users/tobias/programs/petrack-deps -DCatch2_DIR=/Users/tobias/programs/petrack-deps/lib/cmake/Catch2/ -Dtrompeloeil_DIR=/Users/tobias/programs/petrack-deps/lib/cmake/trompeloeil/
- cmake --build .
- cpack -C Release -G DragNDrop --verbose
- rm -r petrack.app
- find _CPack_Packages/ -type d -name "petrack.app" | xargs -I _ cp -r _ petrack.app
artifacts:
paths:
- "./build/"
expire_in: 2 hrs
## Execute unit tests
unit_test_macos:
stage: test
tags:
- macos
script:
- cd build/tests/unit_test
- ./petrack_tests -r junit -o unit_test_report.xml
artifacts:
when: always
paths:
- build/tests/unit_test/unit_test_report.xml
reports:
junit: "build/tests/unit_test/unit_test_report.xml"
needs: ["build_macos"]
## Execute regression tests
regression_test_macos:
stage: test
tags:
- macos
script:
- cd tests/regression_test/tests
- python3 -m pytest --path=../../../build/petrack.app/Contents/MacOS/petrack --junitxml=pytest_report.xml | tee "RegressionTestLog.txt"
artifacts:
when: on_failure
paths:
- "tests/regression_test/tests/RegressionTestLog.txt"
reports:
junit: "tests/regression_test/tests/pytest_report.xml"
needs: ["build_macos"]
build_installer_macos:
stage: build_installer
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
tags:
- macos
script:
- cd build
artifacts:
paths:
- "build-bundle/petrack-installer-*"
expire_in: 2hrs
make_release_macos:
image: alpine
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
needs: ["build_installer_macos"]
script:
- apk --no-cache add curl
- cd build-bundle
- macosInst=$(echo petrack-installer-*)
- curl -k -T $macosInst -u "${SCIEBO_MACOS_INSTALLER_PATH}:" https://fz-juelich.sciebo.de/public.php/webdav/$macosInst
...@@ -142,7 +142,7 @@ endif () ...@@ -142,7 +142,7 @@ endif ()
# Qt # Qt
find_package( find_package(
Qt5 5.14 Qt5 5.14
COMPONENTS Widgets OpenGL Xml Core PrintSupport Concurrent COMPONENTS Widgets OpenGL Xml Core PrintSupport Concurrent Test
REQUIRED REQUIRED
) )
message("Building with Qt${QT_DEFAULT_MAJOR_VERSION} (${Qt5Core_VERSION_STRING})") message("Building with Qt${QT_DEFAULT_MAJOR_VERSION} (${Qt5Core_VERSION_STRING})")
...@@ -289,8 +289,6 @@ if(BUILD_UNIT_TESTS) ...@@ -289,8 +289,6 @@ if(BUILD_UNIT_TESTS)
find_package(trompeloeil REQUIRED) find_package(trompeloeil REQUIRED)
endif() endif()
find_package(Qt5Test REQUIRED)
add_subdirectory(${CMAKE_SOURCE_DIR}/tests/unit_test) add_subdirectory(${CMAKE_SOURCE_DIR}/tests/unit_test)
target_link_libraries(petrack_tests PRIVATE petrack_core git-info) target_link_libraries(petrack_tests PRIVATE petrack_core git-info)
......
...@@ -41,21 +41,23 @@ elseif(APPLE) ...@@ -41,21 +41,23 @@ elseif(APPLE)
INSTALL_RPATH @executable_path/../Frameworks INSTALL_RPATH @executable_path/../Frameworks
) )
install(CODE [[ install(CODE [[
include(BundleUtilities) include(BundleUtilities)
# This string is crazy-long enough that it's worth folding into a var...
set (_plugin_file "$<TARGET_FILE_NAME:Qt5::QCocoaIntegrationPlugin>")
# Ditto the output paths for our installation # the output paths for our installation
set (_appdir "${CMAKE_INSTALL_PREFIX}/petrack.app") set (_appdir "${CMAKE_INSTALL_PREFIX}/petrack.app")
set (_outdir "${_appdir}/Contents/PlugIns/platforms") set (_outdir "${_appdir}/Contents/PlugIns/platforms")
file(INSTALL DESTINATION "${_outdir}" # copy the needed plugins
TYPE FILE FILES "$<TARGET_FILE:Qt5::QCocoaIntegrationPlugin>") file(INSTALL DESTINATION "${_outdir}"
TYPE FILE FILES "$<TARGET_FILE:Qt5::QCocoaIntegrationPlugin>" "$<TARGET_FILE:Qt5::QOffscreenIntegrationPlugin>")
fixup_bundle("${_appdir}/Contents/MacOS/petrack" "${_outdir}/${_plugin_file}" "") fixup_bundle(
]] COMPONENT Runtime) "${_appdir}/Contents/MacOS/petrack"
"${_outdir}/$<TARGET_FILE_NAME:Qt5::QCocoaIntegrationPlugin>;${_outdir}/$<TARGET_FILE_NAME:Qt5::QOffscreenIntegrationPlugin>"
""
)
]] COMPONENT Runtime)
endif() endif()
......
...@@ -38,7 +38,7 @@ def petrack_on_testdata(request, pytestconfig): ...@@ -38,7 +38,7 @@ def petrack_on_testdata(request, pytestconfig):
truth_path = "../data/" + request.param + "_truth" truth_path = "../data/" + request.param + "_truth"
project = "../data/" + request.param + ".pet" project = "../data/" + request.param + ".pet"
output = test_path output = test_path
subprocess.run([petrack_path, "-project", project, "-autotrack", output, "-platform", "offscreen"], check=True, stdout=subprocess.DEVNULL) subprocess.run([petrack_path, "-project", project, "-autotrack", output, "-platform", "offscreen"], check=True)
yield test_path, truth_path yield test_path, truth_path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment