build: Use home directory for Circle-CI test run

This commit is contained in:
Martin Atkins 2019-09-10 15:36:07 -07:00
parent d2dae93c75
commit 18eab5520f
2 changed files with 5 additions and 6 deletions

View File

@ -5,13 +5,12 @@ jobs:
- image: circleci/golang:1.12
environment:
GO111MODULE: "on"
working_directory: /hcl
steps:
- checkout
- run:
name: "Prepare Artifact Store"
command: |
mkdir -p /artifacts
mkdir -p /tmp/artifacts
- restore_cache:
keys:
- v1-mod-cache

View File

@ -4,9 +4,9 @@ set -e
echo "" > coverage.txt
for d in $(go list ./... | grep -v vendor); do
go test -coverprofile=/artifacts/profile.out -covermode=atomic $d
if [ -f /artifacts/profile.out ]; then
cat /artifacts/profile.out >> /artifacts/coverage.txt
rm /artifacts/profile.out
go test -coverprofile=/tmp/artifacts/profile.out -covermode=atomic $d
if [ -f /tmp/artifacts/profile.out ]; then
cat /tmp/artifacts/profile.out >> /tmp/artifacts/coverage.txt
rm /tmp/artifacts/profile.out
fi
done