-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
version: 2 # use CircleCI 2.0 | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
docker: | ||
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/ | ||
- image: circleci/golang:1.14 | ||
|
||
environment: # environment variables for the build itself | ||
TEST_RESULTS: /tmp/test-results # path to where test results will be saved | ||
|
||
steps: # steps that comprise the `build` job | ||
- checkout # check out source code to working directory | ||
- run: mkdir -p ${TEST_RESULTS} # create the test results directory | ||
- restore_cache: # restores saved cache if no changes are detected since last run | ||
keys: | ||
- go-mod-v4-{{ checksum "go.sum" }} | ||
|
||
- run: | ||
name: Run unit tests | ||
command: go test -coverprofile=coverage.txt ./...; cp coverage.txt ${TEST_RESULTS} | ||
|
||
- run: | ||
name: Upload codecov | ||
command: bash <(curl -s https://codecov.io/bash) | ||
|
||
- save_cache: | ||
key: go-mod-v4-{{ checksum "go.sum" }} | ||
paths: | ||
- "/go/pkg/mod" | ||
|
||
- store_artifacts: # upload test summary for display in Artifacts | ||
path: /tmp/test-results | ||
destination: raw-test-output | ||
|
||
- store_test_results: # upload test results for display in Test Summary | ||
path: /tmp/test-results | ||
|
||
release: | ||
|
||
docker: | ||
- image: circleci/golang:1.14 | ||
|
||
steps: | ||
- checkout | ||
- restore_cache: # restores saved cache if no changes are detected since last run | ||
keys: | ||
- go-mod-v4-{{ checksum "go.sum" }} | ||
|
||
- run: | ||
name: Set GoReleaser Version | ||
command: | | ||
echo "export VERSION=v0.128.0" >> $BASH_ENV | ||
- run: | ||
name: "Run GoReleaser" | ||
command: curl -sL https://git.io/goreleaser | bash | ||
|
||
build-dist: | ||
|
||
docker: | ||
- image: circleci/golang:1.14 | ||
|
||
steps: | ||
- checkout | ||
- restore_cache: # restores saved cache if no changes are detected since last run | ||
keys: | ||
- go-mod-v4-{{ checksum "go.sum" }} | ||
|
||
- run: | ||
name: Set GoReleaser Version | ||
command: | | ||
echo "export VERSION=v0.128.0" >> $BASH_ENV | ||
- run: | ||
name: "Run GoReleaser" | ||
command: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist | ||
|
||
workflows: | ||
version: 2 | ||
build-and-release: | ||
jobs: | ||
- build | ||
- release: | ||
requires: | ||
- build | ||
filters: # Only run on git tag pushes | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /v[0-9]+(\.[0-9]+)*(-.*)*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ archives: | |
files: | ||
- LICENSE | ||
- README.md | ||
- samples/**/* | ||
- install/**/* | ||
release: | ||
draft: true | ||
prerelease: true |