mirror of
https://github.com/wahyd4/forego.git
synced 2026-08-08 21:01:01 +10:00
Test build with CircleCI v2.0 (#109)
This commit is contained in:
committed by
David Dollar
parent
b41805148d
commit
04887c4f17
@@ -0,0 +1,61 @@
|
||||
# Golang CircleCI 2.0 configuration file
|
||||
#
|
||||
# Check https://circleci.com/docs/2.0/language-go/ for more details
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
# specify the version
|
||||
- image: circleci/golang:1.9
|
||||
|
||||
working_directory: /go/src/github.com/nzsmartie/forego
|
||||
|
||||
environment:
|
||||
TEST_RESULTS: /tmp/test-results
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run: go get github.com/daviddengcn/go-colortext
|
||||
- run: go get github.com/subosito/gotenv
|
||||
|
||||
# For capturing test results
|
||||
- run: go get github.com/jstemmer/go-junit-report
|
||||
- run: mkdir -p $TEST_RESULTS
|
||||
|
||||
# specify any bash command here prefixed with `run: `
|
||||
- run:
|
||||
name: Run unit tests
|
||||
command: |
|
||||
trap "go-junit-report <${TEST_RESULTS}/forego-tests.log > ${TEST_RESULTS}/forego-tests-report.xml" EXIT
|
||||
make test | tee ${TEST_RESULTS}/forego-tests.log
|
||||
|
||||
- store_artifacts:
|
||||
path: /tmp/test-results
|
||||
destination: raw-test-output
|
||||
|
||||
- store_test_results:
|
||||
path: /tmp/test-results
|
||||
release:
|
||||
docker:
|
||||
- image: circleci/golang:1.9
|
||||
|
||||
working_directory: /go/src/github.com/nzsmartie/forego
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run: go get github.com/daviddengcn/go-colortext
|
||||
- run: go get github.com/subosito/gotenv
|
||||
|
||||
- run: make release
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
deployment:
|
||||
jobs:
|
||||
- build
|
||||
- release:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
@@ -1,5 +1,5 @@
|
||||
BIN = forego
|
||||
SRC = $(shell ls *.go)
|
||||
SRC = $(shell find . -name '*.go' -not -path './vendor/*')
|
||||
|
||||
.PHONY: all build clean lint release test
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
test:
|
||||
override:
|
||||
- make test
|
||||
|
||||
deployment:
|
||||
master:
|
||||
branch: master
|
||||
commands:
|
||||
- make release
|
||||
Reference in New Issue
Block a user