Skip to content

Instantly share code, notes, and snippets.

@roopakv
Created September 16, 2019 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roopakv/cf217e3f4585cd82733ab0ef63bb01d3 to your computer and use it in GitHub Desktop.
Save roopakv/cf217e3f4585cd82733ab0ef63bb01d3 to your computer and use it in GitHub Desktop.
commands:
make-check:
description: Runs tests
steps:
- restore_cache:
keys:
- go-mod-1-13-v1-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}
- go-mod-1-13-v1-{{ checksum "go.mod" }}
- go-mod-1-13-v1-
- run:
name: Go tests for hail
shell: /bin/bash
command: |
set -e
cd /home/circleci/project/
# Improve sharding: https://github.com/golang/go/issues/33527
PACKAGES="$(go list ./... | circleci tests split --split-by=timings --timings-type=classname)"
export PACKAGE_NAMES=$(echo $PACKAGES | tr -d '\n')
export BUILD_NUM=$CIRCLE_BUILD_NUM
export SHA1=$CIRCLE_SHA1
echo "Testing the following packages:"
echo $PACKAGE_NAMES
gotestsum --junitfile $ARTIFACTS_DIR/report.xml -- -covermode=count -coverprofile=$ARTIFACTS_DIR/coverage_tmp.out -p 1 $PACKAGE_NAMES
- save_cache:
key: go-mod-1-13-v1-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment