From 56aa497b9dc0230161f014de55dfcff9d89b371d Mon Sep 17 00:00:00 2001 From: Jakub Date: Tue, 23 Jan 2024 11:49:50 +0100 Subject: [PATCH] feat(GODT-3169): load pipeline env from bridge internal. --- .gitlab-ci.yml | 3 +-- ci/env.yml | 35 +++++++---------------------------- ci/setup.yml | 7 +++++++ ci/test.yml | 28 +++++++++++++++++----------- 4 files changed, 32 insertions(+), 41 deletions(-) create mode 100644 ci/setup.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 44f556b4..ba8d8f7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,8 +16,6 @@ # along with ProtonMail Bridge. If not, see . --- -image: gitlab.protontech.ch:4567/go/bridge-internal:test-go1.20 - default: tags: - shared-small @@ -35,6 +33,7 @@ stages: - build include: + - local: ci/setup.yml - local: ci/rules.yml - local: ci/env.yml - local: ci/test.yml diff --git a/ci/env.yml b/ci/env.yml index 4968666a..4252b93b 100644 --- a/ci/env.yml +++ b/ci/env.yml @@ -4,18 +4,8 @@ .env-windows: before_script: - export BRIDGE_SYNC_FORCE_MINIMUM_SPEC=1 - - export GOROOT=/c/Go1.20/ - - export PATH=$GOROOT/bin:$PATH - - export GOARCH=amd64 - - export GOPATH=~/go1.20 - - export GO111MODULE=on - - export PATH="${GOPATH}/bin:${PATH}" - - export MSYSTEM= - - export QT6DIR=/c/grrrQt/6.4.3/msvc2019_64 - - export PATH=$PATH:${QT6DIR}/bin - - export PATH="/c/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin:$PATH" - - $(git config --global -l | grep -o 'url.*gitlab.protontech.ch.*insteadof' | xargs -L 1 git config --global --unset &> /dev/null) || echo "nothing to remove" - - git config --global url.https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}.insteadOf https://${CI_SERVER_HOST} + - !reference [.before-script-windows-aws-build, before_script] + - !reference [.before-script-git-config, before_script] - git config --global safe.directory '*' - git status --porcelain cache: {} @@ -25,23 +15,14 @@ .env-darwin: before_script: - export BRIDGE_SYNC_FORCE_MINIMUM_SPEC=1 - - export PATH=/usr/local/bin:$PATH - - export PATH=/usr/local/opt/git/bin:$PATH - - export PATH=/usr/local/opt/make/libexec/gnubin:$PATH - - export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH - - export GOROOT=~/local/opt/go@1.20 - - export PATH="${GOROOT}/bin:$PATH" - - export GOPATH=~/go1.20 - - export PATH="${GOPATH}/bin:$PATH" - - export QT6DIR=/opt/Qt/6.4.3/macos - - export PATH="${QT6DIR}/bin:$PATH" - - uname -a + - !reference [.before-script-darwin-build, before_script] cache: {} tags: - macos-m1-bridge .env-linux-build: - image: gitlab.protontech.ch:4567/go/bridge-internal:build-go1.20-qt6.4.3 + extends: + - .image-linux-build variables: VCPKG_DEFAULT_BINARY_CACHE: ${CI_PROJECT_DIR}/.cache cache: @@ -50,13 +31,11 @@ - .cache when: 'always' before_script: - - mkdir -p .cache/bin - export BRIDGE_SYNC_FORCE_MINIMUM_SPEC=1 + - !reference [.before-script-git-config, before_script] + - mkdir -p .cache/bin - export PATH=$(pwd)/.cache/bin:$PATH - export GOPATH="$CI_PROJECT_DIR/.cache" - - export PATH=$PATH:$QT6DIR/bin - - $(git config --global -l | grep -o 'url.*gitlab.protontech.ch.*insteadof' | xargs -L 1 git config --global --unset &> /dev/null) || echo "nothing to remove" - - git config --global url.https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}.insteadOf https://${CI_SERVER_HOST} tags: - shared-large diff --git a/ci/setup.yml b/ci/setup.yml new file mode 100644 index 00000000..9c6b63f7 --- /dev/null +++ b/ci/setup.yml @@ -0,0 +1,7 @@ +--- + +include: + - project: 'go/bridge-internal' + ref: 'feat/godt-3160' + file: 'ci/runners-setup.yml' + diff --git a/ci/test.yml b/ci/test.yml index 5b8e055b..6b7475f9 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -4,15 +4,17 @@ lint: stage: test extends: + - .image-linux-test - .rules-branch-manual-br-tag-and-MR-and-devel-always script: - make lint tags: - shared-medium -bug-report-preview: +lint-bug-report-preview: stage: test extends: + - .image-linux-test - .rules-branch-and-MR-manual script: - make lint-bug-report-preview @@ -31,13 +33,25 @@ bug-report-preview: 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 @@ -86,19 +100,10 @@ test-integration-nightly: paths: - nightly-job.log -test-windows: - extends: - - .env-windows - - .script-test - -test-darwin: - extends: - - .env-darwin - - .script-test - test-coverage: stage: test extends: + - .image-linux-test - .rules-branch-manual-scheduled-and-test-branch-always script: - ./utils/coverage.sh @@ -123,6 +128,7 @@ test-coverage: go-vuln-check: extends: + - .image-linux-test - .rules-branch-manual-MR-and-devel-always stage: test tags: