From bd08eb3d975bc769d635311fe152c8b96837597c Mon Sep 17 00:00:00 2001 From: Alvin Huang <17609145+alvin-huang@users.noreply.github.com> Date: Fri, 17 Jul 2020 13:00:31 -0400 Subject: [PATCH] ci: separate install-gotestsum step into its own config (#8327) --- .circleci/config.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c8ecb68134..d2ca960cd2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,6 @@ references: environment: &ENVIRONMENT TEST_RESULTS_DIR: *TEST_RESULTS_DIR - GOTESTSUM_RELEASE: 0.4.2 EMAIL: noreply@hashicorp.com GIT_AUTHOR_NAME: circleci-consul GIT_COMMITTER_NAME: circleci-consul @@ -24,6 +23,16 @@ references: BASH_ENV: .circleci/bash_env.sh VAULT_BINARY_VERSION: 1.2.2 +steps: + install-gotestsum: &install-gotestsum + name: install gotestsum + environment: + GOTESTSUM_RELEASE: 0.5.1 + command: | + url=https://github.com/gotestyourself/gotestsum/releases/download + curl -sSL "${url}/v${GOTESTSUM_RELEASE}/gotestsum_${GOTESTSUM_RELEASE}_linux_amd64.tar.gz" | \ + sudo tar -xz --overwrite -C /usr/local/bin gotestsum + jobs: # lint consul tests lint-consul-retry: @@ -95,12 +104,7 @@ jobs: at: /go/bin - run: sudo apt-get update && sudo apt-get install -y rsyslog - run: sudo service rsyslog start - - run: &install_gotestsum - name: Install gotestsum - command: | - url=https://github.com/gotestyourself/gotestsum/releases/download - curl -sSL "${url}/v${GOTESTSUM_RELEASE}/gotestsum_${GOTESTSUM_RELEASE}_linux_amd64.tar.gz" | \ - sudo tar -xz --overwrite -C /usr/local/bin gotestsum + - run: *install-gotestsum - run: go mod download - run: name: go test @@ -137,7 +141,7 @@ jobs: - checkout - attach_workspace: at: /go/bin - - run: *install_gotestsum + - run: *install-gotestsum - run: working_directory: api command: go mod download @@ -169,7 +173,7 @@ jobs: - checkout - attach_workspace: at: /go/bin - - run: *install_gotestsum + - run: *install-gotestsum - run: working_directory: sdk command: go mod download @@ -333,7 +337,7 @@ jobs: command: make pkg/linux_amd64/nomad working_directory: *NOMAD_WORKING_DIR - - run: *install_gotestsum + - run: *install-gotestsum # run integration tests - run: