From 312993e08ee93cb36779cb04ad75b7d39a3faef5 Mon Sep 17 00:00:00 2001 From: Jakub Cuth Date: Mon, 11 Mar 2024 15:48:09 +0000 Subject: [PATCH] feat(GODT-3253): windows cache and paths. --- Makefile | 4 +- ci/build.yml | 2 +- ci/env.yml | 6 +- ci/test.yml | 224 +++++++++--------- .../bridge-gui/bridge-gui/CMakeLists.txt | 2 +- .../bridge-gui/bridge-gui/DeployWindows.cmake | 2 +- .../frontend/bridge-gui/bridge-gui/build.ps1 | 3 +- 7 files changed, 124 insertions(+), 119 deletions(-) diff --git a/Makefile b/Makefile index add5097e..aac75752 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ ifeq "${TARGET_OS}" "darwin" mv ${BRIDGE_EXE} ${BRIDGE_EXE_NAME} endif -go-build=go build $(1) -o "$(2)" "$(3)" +go-build=go build $(1) -o $(2) $(3) go-build-finalize=${go-build} ifeq "${GOOS}-$(shell uname -m)" "darwin-arm64" go-build-finalize= \ @@ -118,7 +118,7 @@ versioner: go build ${BUILD_FLAGS} -o versioner utils/versioner/main.go vault-editor: - $(call go-build-finalize,"-tags=debug","vault-editor","./utils/vault-editor/main.go") + $(call go-build-finalize,-tags=debug,"vault-editor","./utils/vault-editor/main.go") bridge-rollout: $(call go-build-finalize,, "bridge-rollout","./utils/bridge-rollout/bridge-rollout.go") diff --git a/ci/build.yml b/ci/build.yml index e43eaec8..432ed060 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -10,7 +10,7 @@ - which go && go version - which gcc && gcc --version - which qmake && qmake --version - - make -d build + - make build - git diff && git diff-index --quiet HEAD - make vault-editor - make bridge-rollout diff --git a/ci/env.yml b/ci/env.yml index 67e07144..27d51491 100644 --- a/ci/env.yml +++ b/ci/env.yml @@ -14,7 +14,11 @@ GOARCH: amd64 BRIDGE_SYNC_FORCE_MINIMUM_SPEC: 1 VCPKG_DEFAULT_BINARY_CACHE: ${CI_PROJECT_DIR}/.cache - cache: {} + cache: + key: windows-vcpkg-go-0 + paths: + - .cache + when: 'always' .env-darwin: extends: diff --git a/ci/test.yml b/ci/test.yml index 89ac4d8d..aba9d33c 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -28,125 +28,125 @@ lint-bug-report-preview: script: - which go && go version - which gcc && gcc --version - - make -d test + - make test artifacts: paths: - coverage/** -# -# -# test-linux: -# extends: -# - .image-linux-test -# - .script-test -# tags: -# - shared-large + + +test-linux: + extends: + - .image-linux-test + - .script-test + tags: + - shared-large test-windows: extends: - .env-windows - .script-test -# test-darwin: -# extends: -# - .env-darwin -# - .script-test -# -# fuzz-linux: -# stage: test -# extends: -# - .image-linux-test -# - .rules-branch-manual-MR-and-devel-always -# script: -# - make fuzz -# tags: -# - shared-large -# -# test-linux-race: -# extends: -# - test-linux -# - .rules-branch-and-MR-manual -# script: -# - make test-race -# -# test-integration: -# extends: -# - test-linux -# script: -# - make test-integration | tee -a integration-job.log -# after_script: -# - | -# grep "Error: " integration-job.log -# artifacts: -# when: always -# paths: -# - integration-job.log -# -# test-integration-race: -# extends: -# - test-integration -# - .rules-branch-and-MR-manual -# script: -# - make test-integration-race | tee -a integration-race-job.log -# artifacts: -# when: always -# paths: -# - integration-race-job.log -# -# -# test-integration-nightly: -# extends: -# - test-integration -# - .rules-branch-manual-scheduled-and-test-branch-always -# needs: -# - test-integration -# script: -# - make test-integration-nightly | tee -a nightly-job.log -# after_script: -# - | -# grep "Error: " nightly-job.log -# artifacts: -# when: always -# paths: -# - nightly-job.log -# -# test-coverage: -# stage: test -# extends: -# - .image-linux-test -# - .rules-branch-manual-scheduled-and-test-branch-always -# script: -# - ./utils/coverage.sh -# coverage: '/total:.*\(statements\).*\d+\.\d+%/' -# needs: -# - test-linux -# - test-windows -# - test-darwin -# - test-integration -# - test-integration-nightly -# tags: -# - shared-small -# artifacts: -# paths: -# - coverage* -# - coverage/** -# when: 'always' -# reports: -# coverage_report: -# coverage_format: cobertura -# path: coverage.xml -# -# go-vuln-check: -# extends: -# - .image-linux-test -# - .rules-branch-manual-MR-and-devel-always -# stage: test -# tags: -# - shared-medium -# script: -# - ./utils/govulncheck.sh -# artifacts: -# when: always -# paths: -# - vulns* -# +test-darwin: + extends: + - .env-darwin + - .script-test + +fuzz-linux: + stage: test + extends: + - .image-linux-test + - .rules-branch-manual-MR-and-devel-always + script: + - make fuzz + tags: + - shared-large + +test-linux-race: + extends: + - test-linux + - .rules-branch-and-MR-manual + script: + - make test-race + +test-integration: + extends: + - test-linux + script: + - make test-integration | tee -a integration-job.log + after_script: + - | + grep "Error: " integration-job.log + artifacts: + when: always + paths: + - integration-job.log + +test-integration-race: + extends: + - test-integration + - .rules-branch-and-MR-manual + script: + - make test-integration-race | tee -a integration-race-job.log + artifacts: + when: always + paths: + - integration-race-job.log + + +test-integration-nightly: + extends: + - test-integration + - .rules-branch-manual-scheduled-and-test-branch-always + needs: + - test-integration + script: + - make test-integration-nightly | tee -a nightly-job.log + after_script: + - | + grep "Error: " nightly-job.log + artifacts: + when: always + paths: + - nightly-job.log + +test-coverage: + stage: test + extends: + - .image-linux-test + - .rules-branch-manual-scheduled-and-test-branch-always + script: + - ./utils/coverage.sh + coverage: '/total:.*\(statements\).*\d+\.\d+%/' + needs: + - test-linux + - test-windows + - test-darwin + - test-integration + - test-integration-nightly + tags: + - shared-small + artifacts: + paths: + - coverage* + - coverage/** + when: 'always' + reports: + coverage_report: + coverage_format: cobertura + path: coverage.xml + +go-vuln-check: + extends: + - .image-linux-test + - .rules-branch-manual-MR-and-devel-always + stage: test + tags: + - shared-medium + script: + - ./utils/govulncheck.sh + artifacts: + when: always + paths: + - vulns* + diff --git a/internal/frontend/bridge-gui/bridge-gui/CMakeLists.txt b/internal/frontend/bridge-gui/bridge-gui/CMakeLists.txt index 2c14ed83..2cadd2bd 100644 --- a/internal/frontend/bridge-gui/bridge-gui/CMakeLists.txt +++ b/internal/frontend/bridge-gui/bridge-gui/CMakeLists.txt @@ -140,7 +140,7 @@ if (WIN32) # on Windows, we add a (non-Qt) resource file that contains the appli endif() target_precompile_headers(bridge-gui PRIVATE Pch.h) -target_include_directories(bridge-gui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${SENTRY_CONFIG_GENERATED_FILE_DIR}) +target_include_directories(bridge-gui PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" ${SENTRY_CONFIG_GENERATED_FILE_DIR}) target_link_libraries(bridge-gui Qt6::Widgets Qt6::Core diff --git a/internal/frontend/bridge-gui/bridge-gui/DeployWindows.cmake b/internal/frontend/bridge-gui/bridge-gui/DeployWindows.cmake index 85573307..9fb8038c 100644 --- a/internal/frontend/bridge-gui/bridge-gui/DeployWindows.cmake +++ b/internal/frontend/bridge-gui/bridge-gui/DeployWindows.cmake @@ -31,7 +31,7 @@ macro( AppendLib LIB_NAME HINT_PATH) if( ${PATH_${UP_NAME}} STREQUAL "PATH_${UP_NAME}-NOTFOUND") message(SEND_ERROR "${LIB_NAME} was not found in ${HINT_PATH}") else() - list(APPEND DEPLOY_LIBS ${PATH_${UP_NAME}}) + list(APPEND DEPLOY_LIBS "${PATH_${UP_NAME}}") endif() endmacro() diff --git a/internal/frontend/bridge-gui/bridge-gui/build.ps1 b/internal/frontend/bridge-gui/bridge-gui/build.ps1 index 2534dd5d..f4b98afb 100644 --- a/internal/frontend/bridge-gui/bridge-gui/build.ps1 +++ b/internal/frontend/bridge-gui/bridge-gui/build.ps1 @@ -102,6 +102,7 @@ git submodule update --init --recursive $vcpkgRoot -S . -B $buildDir check_exit "CMake failed" + . $cmakeExe --build $buildDir --config "$buildConfig" check_exit "Build failed" @@ -109,7 +110,7 @@ if ($($args.count) -gt 0 ) { if ($args[0] = "install") { - . $cmakeExe --install $buildDir + . $cmakeExe --install "$buildDir" -v check_exit "Install failed" } }