From a2151eed9da79a027ea888b2ea92bbbd52188966 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Tue, 17 Oct 2023 20:34:06 +0300 Subject: [PATCH] added `make tidy` step to ci, replaced `go download` from release --- build/ci.yml | 16 ++++++++++++++-- build/release.yml | 48 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/build/ci.yml b/build/ci.yml index c5d353b1..11b7a187 100644 --- a/build/ci.yml +++ b/build/ci.yml @@ -43,6 +43,18 @@ steps: on: - success + download_modules: + <<: *deps + stage: Prepare + title: download modules + commands: + - make tidy + when: + steps: + - name: prepare_env_vars + on: + - success + lint: <<: *deps stage: Test @@ -52,10 +64,10 @@ steps: - make check-worktree when: steps: - - name: prepare_env_vars + - name: clean on: - success - - name: clean + - name: download_modules on: - success diff --git a/build/release.yml b/build/release.yml index 33215e43..ba9798a5 100644 --- a/build/release.yml +++ b/build/release.yml @@ -8,7 +8,6 @@ stages: - Release steps: - main_clone: stage: Prepare title: clone repository @@ -22,10 +21,6 @@ steps: title: check version image: quay.io/codefresh/golang-ci-helper:1.21.1 commands: - - cf_export GO111MODULE=on - - cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume - - cf_export GOPATH=/codefresh/volume/gopath - - cf_export PATH=$PATH:/codefresh/volume/gopath/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin # must have brew in path for final brew step - (echo "${{CF_BRANCH}}" | grep -Eq '^release-v(\d+\.)?(\d+\.)?(\*|\d+)$') && echo on release branch || (echo not on release branch && exit 1) - RELEASE_VER=$(echo ${{CF_BRANCH_TAG_NORMALIZED_LOWER_CASE}} | sed -E 's/^release-([^"]+).*/\1/') - cf_export RELEASE_VER=$RELEASE_VER @@ -36,19 +31,45 @@ steps: on: - success - download_modules: + prepare_env_vars: <<: *deps stage: Prepare - title: download go modules + title: prepare-env commands: - - make clean - - go mod download -x + - cf_export GO111MODULE=on + - cf_export GOCACHE=/codefresh/volume/gocache # change gopath to codefresh shared volume + - cf_export GOPATH=/codefresh/volume/gopath + - cf_export PATH=$PATH:/codefresh/volume/gopath/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin # must have brew in path for final brew step when: steps: - name: check_version on: - success + clean: + <<: *deps + stage: Prepare + title: clean + commands: + - make clean + when: + steps: + - name: check_version + on: + - success + + download_modules: + <<: *deps + stage: Prepare + title: download modules + commands: + - make tidy + when: + steps: + - name: prepare_env_vars + on: + - success + lint: <<: *deps stage: Test @@ -57,9 +78,12 @@ steps: - make lint when: steps: - - name: download_modules - on: - - success + - name: clean + on: + - success + - name: download_modules + on: + - success codegen: <<: *deps