mirror of https://github.com/emirpasic/gods
Switching to CircleCI
parent
7168f7acb7
commit
bc06b65742
@ -1,42 +1,52 @@
|
||||
# Use the latest 2.1 version of CircleCI pipeline process engine.
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference
|
||||
version: 2.1
|
||||
|
||||
# Define a job to be invoked later in a workflow.
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/repo
|
||||
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
|
||||
test:
|
||||
working_directory: /go/src/github.com/emirpasic/gods
|
||||
docker:
|
||||
- image: circleci/golang:1.15.8
|
||||
# Add steps to the job
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
|
||||
- image: circleci/golang:<<parameters.version>>
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Run tests
|
||||
name: Print Go version (go version)
|
||||
command: |
|
||||
go version
|
||||
- run:
|
||||
name: Run tests (gotestsum)
|
||||
command: |
|
||||
mkdir -p /tmp/test-reports
|
||||
gotestsum --junitfile /tmp/test-reports/unit-tests.xml
|
||||
- run:
|
||||
name: Lint
|
||||
name: Lint (golint)
|
||||
command: |
|
||||
go get github.com/golang/lint/golint
|
||||
go install github.com/golang/lint/golint@latest
|
||||
golint -set_exit_status <<parameters.paths>>
|
||||
- run:
|
||||
name: Calculate cyclomatic complexity
|
||||
name: Enforce formatted code (go fmt)
|
||||
command: |
|
||||
! go fmt <<parameters.paths>> 2>&1 | read
|
||||
- run:
|
||||
name: Examine and report suspicious constructs (go vet)
|
||||
command: |
|
||||
go get github.com/fzipp/gocyclo
|
||||
go vet -v <<parameters.paths>>
|
||||
- run:
|
||||
name: Calculate cyclomatic complexity (gocyclo)
|
||||
command: |
|
||||
go install github.com/fzipp/gocyclo@latest
|
||||
gocyclo -avg -over 15 .
|
||||
- run:
|
||||
name: Check for unchecked errors (errcheck)
|
||||
command: |
|
||||
go install github.com/kisielk/errcheck@latest
|
||||
errcheck <<parameters.paths>>
|
||||
- store_test_results:
|
||||
path: /tmp/test-reports
|
||||
|
||||
# Invoke jobs via workflows
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
||||
workflows:
|
||||
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
|
||||
# Inside the workflow, you define the jobs you want to run.
|
||||
test:
|
||||
jobs:
|
||||
- build
|
||||
- test:
|
||||
matrix:
|
||||
parameters:
|
||||
version: ["latest", "1.18", "1.17", "1.2"]
|
||||
# version: ["latest", "1.18", "1.17", "1.16", "1.15", "1.14", "1.13", "1.12", "1.11", "1.10", "1.9", "1.8", "1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]
|
Loading…
Reference in New Issue