-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from dnephin/use-orbs
Use orbs in CI config
- Loading branch information
Showing
11 changed files
with
208 additions
and
201 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 |
---|---|---|
@@ -1,111 +1,123 @@ | ||
version: 2 | ||
version: 2.1 | ||
|
||
jobs: | ||
orbs: | ||
go: gotest/tools@0.0.8 | ||
|
||
workflows: | ||
version: 2 | ||
ci: | ||
jobs: | ||
- test-go-1-10: | ||
name: test-go-1.10 | ||
|
||
- go/test: | ||
name: test-go-1.11 | ||
gotestsum-format: short-verbose | ||
executor: | ||
name: go/golang | ||
tag: 1.11-alpine | ||
|
||
- go/test: | ||
name: test-go-1.12 | ||
gotestsum-format: short-verbose | ||
executor: | ||
name: go/golang | ||
tag: 1.12-alpine | ||
|
||
- go/lint | ||
- build | ||
- run | ||
|
||
lint: | ||
working_directory: /work | ||
docker: [{image: 'docker:18.03-git'}] | ||
- build: | ||
name: release | ||
publish: true | ||
filters: | ||
tags: {only: '/v[0-9]+(\.[0-9]+)*/'} | ||
branches: {ignore: '/.*/'} | ||
|
||
commands: | ||
install-deps: | ||
description: Install dep and dependencies | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
command: docker version | ||
- run: | ||
name: "Install Dependencies" | ||
name: Install dep | ||
command: | | ||
docker build -f dobifiles/Dockerfile \ | ||
--target dev-with-source \ | ||
--tag testsum-builder:$CIRCLE_BUILD_NUM . | ||
docker run --name \ | ||
deps-$CIRCLE_BUILD_NUM testsum-builder:$CIRCLE_BUILD_NUM \ | ||
dep ensure | ||
docker cp \ | ||
deps-$CIRCLE_BUILD_NUM:/go/src/gotest.tools/gotestsum/vendor \ | ||
. | ||
command -v dep && exit | ||
wget -O- -q https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
- run: | ||
name: "Lint" | ||
command: | | ||
docker build -f dobifiles/Dockerfile \ | ||
--target linter-with-source \ | ||
--tag testsum-linter:$CIRCLE_BUILD_NUM . | ||
docker run --rm testsum-linter:$CIRCLE_BUILD_NUM | ||
name: Install dependencies | ||
command: dep ensure | ||
|
||
test-golang-1.10: | ||
working_directory: /work | ||
docker: [{image: 'docker:17.06-git'}] | ||
install-goreleaser: | ||
description: Install goreleaser | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: "Unit Test GO 1.10" | ||
name: Install goreleaser | ||
command: | | ||
scripts/ci/test 1.10.3-alpine | ||
mkdir -p junit/gotest | ||
docker cp \ | ||
test-$CIRCLE_BUILD_NUM:/go/src/gotest.tools/gotestsum/junit.xml \ | ||
junit/gotest/junit.xml | ||
command -v goreleaser && exit | ||
wget -O- -q https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh | ||
- store_test_results: | ||
path: junit/ | ||
jobs: | ||
|
||
test-golang-1.11: | ||
working_directory: /work | ||
docker: [{image: 'docker:17.06-git'}] | ||
build: | ||
parameters: | ||
publish: | ||
type: boolean | ||
default: false | ||
executor: go/golang | ||
steps: | ||
- go/install-git | ||
- go/install-ssh | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: "Unit Test GO 1.11" | ||
command: | | ||
scripts/ci/test 1.11-alpine | ||
mkdir -p junit/gotest | ||
docker cp \ | ||
test-$CIRCLE_BUILD_NUM:/go/src/gotest.tools/gotestsum/junit.xml \ | ||
junit/gotest/junit.xml | ||
- store_test_results: | ||
path: junit/ | ||
- go/mod-download | ||
- go/mod-tidy-check | ||
- install-goreleaser | ||
- unless: | ||
condition: << parameters.publish >> | ||
steps: | ||
run: | ||
name: build binaries | ||
command: bin/goreleaser --rm-dist --snapshot | ||
- when: | ||
condition: << parameters.publish >> | ||
steps: | ||
run: | ||
name: build and publish binaries | ||
command: bin/goreleaser --rm-dist --skip-validate | ||
- store_artifacts: | ||
path: ./dist | ||
destination: dist | ||
|
||
test-golang-1.12: | ||
working_directory: /work | ||
docker: [{image: 'docker:17.06-git'}] | ||
test-go-1-10: | ||
executor: | ||
name: go/golang | ||
tag: 1.10-alpine | ||
working_directory: /go/src/gotest.tools/gotestsum | ||
steps: | ||
- go/install-git | ||
- go/install-ssh | ||
- checkout | ||
- setup_remote_docker | ||
- go/install-gotestsum | ||
- install-deps | ||
- run: | ||
name: "Unit Test GO 1.12" | ||
name: go test | ||
environment: | ||
GOTESTSUM_JUNITFILE: /tmp/test-reports/unit/junit.xml | ||
GOTESTSUM_FORMAT: short-verbose | ||
command: | | ||
scripts/ci/test 1.12rc1-alpine | ||
mkdir -p junit/gotest | ||
docker cp \ | ||
test-$CIRCLE_BUILD_NUM:/go/src/gotest.tools/gotestsum/junit.xml \ | ||
junit/gotest/junit.xml | ||
mkdir -p /tmp/test-reports/unit | ||
gotestsum | ||
- store_test_results: | ||
path: junit/ | ||
path: /tmp/test-reports | ||
|
||
release: | ||
docker: [{image: 'circleci/golang:1.11'}] | ||
working_directory: /go/src/gotest.tools/gotestsum | ||
run: | ||
executor: go/golang | ||
steps: | ||
- go/install-git | ||
- go/install-ssh | ||
- checkout | ||
- deploy: | ||
name: "release" | ||
command: | | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
dep ensure | ||
go get github.com/goreleaser/goreleaser | ||
goreleaser --rm-dist --skip-validate | ||
workflows: | ||
version: 2 | ||
ci: | ||
jobs: | ||
- lint | ||
- test-golang-1.10 | ||
- test-golang-1.11 | ||
- test-golang-1.12 | ||
- release: | ||
filters: | ||
tags: {only: '/v[0-9]+(\.[0-9]+)*/'} | ||
branches: {ignore: '/.*/'} | ||
- go/mod-download | ||
- run: | | ||
mkdir -p dist | ||
go build -o dist/gotestsum . | ||
- run: dist/gotestsum |
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,39 @@ | ||
linters-settings: | ||
gocyclo: | ||
min-complexity: 10 | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 4 | ||
lll: | ||
line-length: 100 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- performance | ||
- style | ||
- experimental | ||
disabled-checks: | ||
- importShadow | ||
- paramTypeCombine | ||
- commentFormatting # https://github.com/go-critic/go-critic/issues/755 | ||
- unnamedResult | ||
settings: | ||
hugeParam: | ||
sizeThreshold: 256 | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude: | ||
# unparam | ||
- 'result .* is always' | ||
- 'always receives' | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- dupl | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- gosec | ||
- scopelint | ||
- maligned |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.