From 76cda0e2aaff7d4d018b170aaf6fbbb864073b25 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 10 Sep 2019 15:20:42 -0700 Subject: build: Switch from Travis-CI to Circle-CI --- .circleci/config.yml | 29 +++++++++++++++++++++++++++++ .circleci/test.sh | 12 ++++++++++++ .travis.sh | 12 ------------ .travis.yml | 17 ----------------- 4 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 .circleci/config.yml create mode 100755 .circleci/test.sh delete mode 100755 .travis.sh delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..eee1e41 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,29 @@ +version: 2 +orbs: + codecov: codecov/codecov@1.0.2 +jobs: + build: + docker: + - image: circleci/golang:1.12 + environment: + GO111MODULE: "on" + working_directory: /hcl + steps: + - checkout + - run: + name: "Prepare Artifact Store" + command: | + mkdir -p /artifacts + - restore_cache: + keys: + - v1-mod-cache + - run: + name: "Tests" + command: | + .circleci/test.sh + - save_cache: + key: v1-mod-cache + paths: + - "/go/pkg/mod" + - codecov/upload: + file: /artifacts/coverage.txt diff --git a/.circleci/test.sh b/.circleci/test.sh new file mode 100755 index 0000000..abf6dfa --- /dev/null +++ b/.circleci/test.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +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 + fi +done diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index 1770fa8..0000000 --- a/.travis.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e -echo "" > coverage.txt - -for d in $(go list ./... | grep -v vendor); do - go test -coverprofile=profile.out -covermode=atomic $d - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5395149..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go - -go: - - 1.11.x - - 1.12.x - -env: - - GO111MODULE=on - -before_install: - - go get -v ./... - -script: - - ./.travis.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) -- cgit v1.2.3