diff --git a/.github/workflows/cicd.yml b/.github/workflows/ci.yml similarity index 80% rename from .github/workflows/cicd.yml rename to .github/workflows/ci.yml index ff0923f9b6..6dbe51a09e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/ci.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/CMakeLists.txt b/CMakeLists.txt index 39628b8fa8..c7637be27f 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") @@ -50,7 +52,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/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/cmake/CuraTests.cmake b/cmake/CuraTests.cmake index 0e62b84efa..babb86f745 100644 --- a/cmake/CuraTests.cmake +++ b/cmake/CuraTests.cmake @@ -49,6 +49,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" @@ -67,13 +75,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" diff --git a/docker/build.sh b/docker/build.sh index 39632b348b..be1c5f9be3 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 \ + -DPRINT_PLUGIN_LIST=OFF \ + -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..9284fede20 --- /dev/null +++ b/docker/test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +cd build +ctest3 -j4 --output-on-failure -T Test