Skip to content

Commit

Permalink
Merge pull request #64 from hashicorp/add-circle-config
Browse files Browse the repository at this point in the history
add circleci config and move to circle
  • Loading branch information
cotarg committed Oct 8, 2019
2 parents aa22b0d + 5d3ebb9 commit 10a89a7
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 14 deletions.
58 changes: 58 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: 2.1

references:
images:
go: &GOLANG_IMAGE circleci/golang:latest
environments:
tmp: &TEST_RESULTS_PATH /tmp/test-results # path to where test results are saved

# reusable 'executor' object for jobs
executors:
go:
docker:
- image: *GOLANG_IMAGE
environment:
- TEST_RESULTS: *TEST_RESULTS_PATH

jobs:
go-test:
executor: go
steps:
- checkout
- run: mkdir -p $TEST_RESULTS

- restore_cache: # restore cache from dev-build job
keys:
- go-version-modcache-v1-{{ checksum "go.mod" }}

# Save go module cache if the go.mod file has changed
- save_cache:
key: go-version-modcache-v1-{{ checksum "go.mod" }}
paths:
- "/go/pkg/mod"

# check go fmt output because it does not report non-zero when there are fmt changes
- run:
name: check go fmt
command: |
files=$(go fmt ./...)
if [ -n "$files" ]; then
echo "The following file(s) do not conform to go fmt:"
echo "$files"
exit 1
fi
# run go tests with gotestsum
- run: |
PACKAGE_NAMES=$(go list ./...)
gotestsum --format=short-verbose --junitfile $TEST_RESULTS/gotestsum-report.xml -- $PACKAGE_NAMES
- store_test_results:
path: *TEST_RESULTS_PATH
- store_artifacts:
path: *TEST_RESULTS_PATH

workflows:
version: 2
test-and-build:
jobs:
- go-test
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Versioning Library for Go
[![Build Status](https://travis-ci.org/hashicorp/go-version.svg?branch=master)](https://travis-ci.org/hashicorp/go-version)
[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/master)

go-version is a library for parsing versions and version constraints,
and verifying versions against a set of constraints. go-version
Expand Down

0 comments on commit 10a89a7

Please sign in to comment.