build: Switch from Travis-CI to Circle-CI
This commit is contained in:
parent
c29bdc1243
commit
76cda0e2aa
29
.circleci/config.yml
Normal file
29
.circleci/config.yml
Normal file
@ -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
|
12
.circleci/test.sh
Executable file
12
.circleci/test.sh
Executable file
@ -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
|
12
.travis.sh
12
.travis.sh
@ -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
|
17
.travis.yml
17
.travis.yml
@ -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)
|
Loading…
Reference in New Issue
Block a user