diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7ea681f --- /dev/null +++ b/.circleci/config.yml @@ -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 diff --git a/Makefile b/Makefile index 9741922..a69d6f5 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 7abe13a..0000000 --- a/circle.yml +++ /dev/null @@ -1,9 +0,0 @@ -test: - override: - - make test - -deployment: - master: - branch: master - commands: - - make release