diff --git a/.circleci/config.yml b/.circleci/config.yml index aa6e476ce..1cb8404de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,12 @@ version: 2.1 references: - GO_VERSION: &GOVERSION 1.12.7 + common_envs: &COMMON_ENVS + GOVERSION: "1.12.7" + GOMAXPROCS: 1 + NOMAD_SLOW_TEST: 1 + GOTESTSUM_JUNITFILE: /tmp/test-reports/results.xml + workflows: build-test: jobs: @@ -85,36 +90,28 @@ jobs: type: string default: "" environment: + <<: *COMMON_ENVS GOTEST_PKGS: "<< parameters.test_packages >>" GOTEST_PKGS_EXCLUDE: "<< parameters.exclude_packages >>" GOPATH: /go - GOTESTSUM_JUNITFILE: /tmp/results.xml - GOMAXPROCS: 1 - NOMAD_SLOW_TEST: 1 steps: - checkout - run-tests - store_test_results: - path: /tmp + path: /tmp/test-reports + - store_artifacts: + path: /tmp/test-reports test-rkt: executor: go-machine environment: + <<: *COMMON_ENVS GOTEST_PKGS: "./drivers/rkt" - GOTESTSUM_JUNITFILE: /tmp/results.xml GOPATH: /home/circleci/go - GOVERSION: *GOVERSION - GOMAXPROCS: 1 - NOMAD_SLOW_TEST: 1 RKT_VERSION: 1.29.0 steps: - checkout - - run: - name: install go - command: | - sudo rm -rf /usr/local/go - wget https://dl.google.com/go/go$GOVERSION.linux-amd64.tar.gz - sudo tar -C /usr/local -xzf go$GOVERSION.linux-amd64.tar.gz + - install-golang - install-protoc - run: name: install rkt @@ -127,7 +124,9 @@ jobs: - run: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap - run-tests - store_test_results: - path: /tmp + path: /tmp/test-reports + - store_artifacts: + path: /tmp/test-reports test-machine: executor: go-machine @@ -139,28 +138,22 @@ jobs: type: string default: "" environment: + <<: *COMMON_ENVS GOTEST_PKGS_EXCLUDE: "<< parameters.exclude_packages >>" GOTEST_PKGS: "<< parameters.test_packages >>" - GOTESTSUM_JUNITFILE: /tmp/results.xml GOPATH: /home/circleci/go - GOVERSION: *GOVERSION - GOMAXPROCS: 1 - NOMAD_SLOW_TEST: 1 steps: - checkout - - run: - name: install go - command: | - sudo rm -rf /usr/local/go - wget https://dl.google.com/go/go$GOVERSION.linux-amd64.tar.gz - sudo tar -C /usr/local -xzf go$GOVERSION.linux-amd64.tar.gz + - install-golang - install-protoc - install-consul - install-vault - run: PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make bootstrap - run-tests - store_test_results: - path: /tmp + path: /tmp/test-reports + - store_artifacts: + path: /tmp/test-reports build-website: # setting the working_directory along with the checkout path allows us to not have @@ -195,6 +188,15 @@ jobs: command: ./scripts/deploy.sh commands: + install-golang: + steps: + - run: + name: install golang + command: | + sudo rm -rf /usr/local/go + wget https://dl.google.com/go/go$GOVERSION.linux-amd64.tar.gz + sudo tar -C /usr/local -xzf go$GOVERSION.linux-amd64.tar.gz + install-vault: parameters: version: @@ -241,5 +243,6 @@ commands: unset GOTEST_PKGS fi + mkdir -p /tmp/test-reports sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make generate-structs sudo -E PATH="$GOPATH/bin:/usr/local/go/bin:$PATH" make test-nomad