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 - image: circleci/golang:1.12
environment: environment:
GO111MODULE: "on" GO111MODULE: "on"
working_directory: /hcl
steps: steps:
- checkout - checkout
- run: - run:
name: "Prepare Artifact Store" name: "Prepare Artifact Store"
command: | command: |
mkdir -p /artifacts mkdir -p /tmp/artifacts
- restore_cache: - restore_cache:
keys: keys:
- v1-mod-cache - v1-mod-cache

View File

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