diff --git a/.circleci/config.yml b/.circleci/config.yml index 89d9ceac85..9642932ad0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 defaults: &defaults docker: - - image: weaveworks/weavebuild:circle20-50a4e941 + - image: weaveworks/weavebuild:circle20-2e6504d3 working_directory: /go/src/github.com/weaveworks/weave jobs: @@ -18,6 +18,10 @@ jobs: steps: - checkout - run: COVERDIR=test/coverage make BUILD_IN_CONTAINER=false tests + - persist_to_workspace: + root: . + paths: + - test/coverage build: <<: *defaults @@ -62,11 +66,25 @@ jobs: - run: command: bin/circle-destroy-vms background: true - - deploy: - command: cd $SRCDIR/test; ./gen_coverage_reports.sh - # run goveralls; copy coverage reports to artifacts dir - - deploy: - command: $SRCDIR/bin/circle-teardown-pre + - persist_to_workspace: + root: . + paths: + - test/coverage + - store_artifacts: + path: /tmp/artifacts + + gen-coverage: + <<: *defaults + environment: + CIRCLE_ARTIFACTS: /tmp/artifacts + steps: + - checkout + - run: mkdir $CIRCLE_ARTIFACTS + - attach_workspace: + at: . + - run: cd test; ./gen_coverage_reports.sh + - run: goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=test/profile.cov -service=circleci + - run: cp test/coverage.* $CIRCLE_ARTIFACTS - store_artifacts: path: /tmp/artifacts @@ -89,6 +107,10 @@ workflows: - lint - unit-test - build + - gen-coverage: + requires: + - unit-test + - smoke-tests - deploy: requires: - smoke-tests diff --git a/.lintignore b/.lintignore index f6b9efd061..9412318290 100644 --- a/.lintignore +++ b/.lintignore @@ -4,7 +4,6 @@ # avoid breaking the build on make lint: bin/circle-deploy-issues bin/circle-deploy-master -bin/circle-teardown-pre bin/circle-test-teardown bin/circle-test-unit bin/install-wordepress diff --git a/bin/circle-teardown-pre b/bin/circle-teardown-pre deleted file mode 100755 index d4ac8e3cda..0000000000 --- a/bin/circle-teardown-pre +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -if [ "$CIRCLE_NODE_INDEX" = "0" ] ; then - go get github.com/mattn/goveralls - goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$SRCDIR/test/profile.cov -service=circleci - cd $SRCDIR/test; cp coverage.* $CIRCLE_ARTIFACTS -fi diff --git a/test/gen_coverage_reports.sh b/test/gen_coverage_reports.sh index 8f9f381697..27a2e46983 100755 --- a/test/gen_coverage_reports.sh +++ b/test/gen_coverage_reports.sh @@ -3,13 +3,8 @@ set -ex DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -if [ -n "$CIRCLECI" ]; then - for i in $(seq 1 $(($CIRCLE_NODE_TOTAL - 1))); do - scp node$i:/home/ubuntu/src/github.com/weaveworks/weave/test/coverage/* ./coverage/ || true - done -fi +# 'cover' tool is from github.com/weaveworks/build-tools/cover -go get github.com/weaveworks/build-tools/cover cover ./coverage/* >profile.cov go tool cover -html=profile.cov -o coverage.html go tool cover -func=profile.cov -o coverage.txt