summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Atkins <mart@degeneration.co.uk>2019-09-10 15:20:42 -0700
committerMartin Atkins <mart@degeneration.co.uk>2019-10-01 15:59:10 -0700
commit76cda0e2aaff7d4d018b170aaf6fbbb864073b25 (patch)
tree2ef02e7e08bc081a33dd13e2ffc8fa3a52c552e5
parentc29bdc124365a08a3a969245a86b43cc0c69f2d7 (diff)
build: Switch from Travis-CI to Circle-CI
-rw-r--r--.circleci/config.yml29
-rwxr-xr-x.circleci/test.sh12
-rwxr-xr-x.travis.sh12
-rw-r--r--.travis.yml17
4 files changed, 41 insertions, 29 deletions
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)