build: Use home directory for Circle-CI test run
This commit is contained in:
parent
d2dae93c75
commit
18eab5520f
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user