From a9c67542bfa118ca7e70921a7b7f884c7851d712 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Aug 2020 16:01:40 +0200 Subject: [PATCH 1/6] Don't generate the translations when running the CI --- CMakeLists.txt | 6 +++++- docker/build.sh | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 035191ebf7..bd5e1599b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ if(CURA_DEBUGMODE) set(_cura_debugmode "ON") endif() +option(GENERATE_TRANSLATIONS "Should the translations be generated?" ON) + set(CURA_APP_NAME "cura" CACHE STRING "Short name of Cura, used for configuration folder") set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura") set(CURA_VERSION "master" CACHE STRING "Version name of Cura") @@ -58,7 +60,9 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") # Extract Strings add_custom_target(extract-messages ${URANIUM_SCRIPTS_DIR}/extract-messages ${CMAKE_SOURCE_DIR} cura) # Build Translations - CREATE_TRANSLATION_TARGETS() + if(${GENERATE_TRANSLATIONS}) + CREATE_TRANSLATION_TARGETS() + endif() endif() diff --git a/docker/build.sh b/docker/build.sh index 39632b348b..f126b38395 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -65,6 +65,7 @@ cmake3 \ -DCMAKE_PREFIX_PATH="${CURA_BUILD_ENV_PATH}" \ -DURANIUM_DIR="${PROJECT_DIR}/Uranium" \ -DBUILD_TESTS=ON \ + -DGENERATE_TRANSLATIONS=OFF .. make ctest3 -j4 --output-on-failure -T Test From dd6467303eecaa365461b6e46089950642b66e2b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Aug 2020 16:21:33 +0200 Subject: [PATCH 2/6] Add option to not print the list of plugins installed. This should make it a lot easier to read the test output --- cmake/CuraPluginInstall.cmake | 10 ++++++++-- docker/build.sh | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/CuraPluginInstall.cmake b/cmake/CuraPluginInstall.cmake index d35e74acb8..8d9efe1f12 100644 --- a/cmake/CuraPluginInstall.cmake +++ b/cmake/CuraPluginInstall.cmake @@ -9,6 +9,8 @@ # form of "a;b;c" or "a,b,c". By default all plugins will be installed. # +option(PRINT_PLUGIN_LIST "Should the list of plugins that are installed be printed?" ON) + # FIXME: Remove the code for CMake <3.12 once we have switched over completely. # FindPython3 is a new module since CMake 3.12. It deprecates FindPythonInterp and FindPythonLibs. The FindPython3 # module is copied from the CMake repository here so in CMake <3.12 we can still use it. @@ -81,7 +83,9 @@ foreach(_plugin_json_path ${_plugin_json_list}) endif() if(_add_plugin) - message(STATUS "[+] PLUGIN TO INSTALL: ${_rel_plugin_dir}") + if(${PRINT_PLUGIN_LIST}) + message(STATUS "[+] PLUGIN TO INSTALL: ${_rel_plugin_dir}") + endif() get_filename_component(_rel_plugin_parent_dir ${_rel_plugin_dir} DIRECTORY) install(DIRECTORY ${_rel_plugin_dir} DESTINATION lib${LIB_SUFFIX}/cura/${_rel_plugin_parent_dir} @@ -90,7 +94,9 @@ foreach(_plugin_json_path ${_plugin_json_list}) ) list(APPEND _install_plugin_list ${_plugin_dir}) elseif(_is_no_install_plugin) - message(STATUS "[-] PLUGIN TO REMOVE : ${_rel_plugin_dir}") + if(${PRINT_PLUGIN_LIST}) + message(STATUS "[-] PLUGIN TO REMOVE : ${_rel_plugin_dir}") + endif() execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/mod_bundled_packages_json.py -d ${CMAKE_CURRENT_SOURCE_DIR}/resources/bundled_packages ${_plugin_dir_name} diff --git a/docker/build.sh b/docker/build.sh index f126b38395..0e2eaaa6ee 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -65,7 +65,8 @@ cmake3 \ -DCMAKE_PREFIX_PATH="${CURA_BUILD_ENV_PATH}" \ -DURANIUM_DIR="${PROJECT_DIR}/Uranium" \ -DBUILD_TESTS=ON \ - -DGENERATE_TRANSLATIONS=OFF + -DPRINT_PLUGIN_LIST=OFF \ + -DGENERATE_TRANSLATIONS=OFF \ .. make ctest3 -j4 --output-on-failure -T Test From 01aa7295772012af439de71793477f4834ec65df Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Aug 2020 16:31:25 +0200 Subject: [PATCH 3/6] Split up build & test This should make the output a bit more segmented (and thus, more readable) --- .github/workflows/cicd.yml | 7 ++++--- docker/build.sh | 1 - docker/test.sh | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100755 docker/test.sh diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index ff0923f9b6..6dbe51a09e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -1,5 +1,5 @@ --- -name: CI/CD +name: CI on: push: branches: @@ -10,11 +10,12 @@ on: pull_request: jobs: build: - name: Build and test runs-on: ubuntu-latest container: ultimaker/cura-build-environment steps: - name: Checkout Cura uses: actions/checkout@v2 - - name: Build and test + - name: Build run: docker/build.sh + - name: Test + run: docker/test.sh diff --git a/docker/build.sh b/docker/build.sh index 0e2eaaa6ee..be1c5f9be3 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -69,4 +69,3 @@ cmake3 \ -DGENERATE_TRANSLATIONS=OFF \ .. make -ctest3 -j4 --output-on-failure -T Test diff --git a/docker/test.sh b/docker/test.sh new file mode 100755 index 0000000000..0de96bc501 --- /dev/null +++ b/docker/test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +cd build +ctest3 -j4 --output-on-failure -T Test \ No newline at end of file From 8b70d1b89e3ab700c04d03d3f6de77d1d2c69b9e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Aug 2020 16:42:22 +0200 Subject: [PATCH 4/6] Move codestyle to the begining of the tests Since it's one of the more expensive tests, it might actually knock off a few seconds --- cmake/CuraTests.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cmake/CuraTests.cmake b/cmake/CuraTests.cmake index 251bec5781..ad435321c9 100644 --- a/cmake/CuraTests.cmake +++ b/cmake/CuraTests.cmake @@ -56,6 +56,14 @@ function(cura_add_test) endif() endfunction() + +#Add code style test. +add_test( + NAME "code-style" + COMMAND ${Python3_EXECUTABLE} run_mypy.py + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +) + #Add test for import statements which are not compatible with all builds add_test( NAME "invalid-imports" @@ -74,13 +82,6 @@ foreach(_plugin ${_plugins}) endif() endforeach() -#Add code style test. -add_test( - NAME "code-style" - COMMAND ${Python3_EXECUTABLE} run_mypy.py - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} -) - #Add test for whether the shortcut alt-keys are unique in every translation. add_test( NAME "shortcut-keys" From 61af8cf9b5df2366c8d626adc132996e22cb38a0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 28 Aug 2020 12:46:58 +0200 Subject: [PATCH 5/6] Rename workflow file to CI --- .github/workflows/{cicd.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cicd.yml => ci.yml} (100%) diff --git a/.github/workflows/cicd.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/cicd.yml rename to .github/workflows/ci.yml From 5f2d721bdca9cdb8fe11117adf76250a8ae0b072 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 28 Aug 2020 12:47:25 +0200 Subject: [PATCH 6/6] Added missing newline at end of file --- docker/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test.sh b/docker/test.sh index 0de96bc501..9284fede20 100755 --- a/docker/test.sh +++ b/docker/test.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash cd build -ctest3 -j4 --output-on-failure -T Test \ No newline at end of file +ctest3 -j4 --output-on-failure -T Test