gods/.circleci/config.yml
2022-04-06 18:01:44 +02:00

56 lines
1.7 KiB
YAML

version: 2.1
jobs:
test:
parameters:
version:
type: string
default: "latest"
working_directory: /go/src/github.com/emirpasic/gods
docker:
- image: circleci/golang:<<parameters.version>>
steps:
- checkout
- run:
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 (golint)
command: |
go install github.com/golang/lint/golint@latest
golint -set_exit_status <<parameters.paths>>
- run:
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 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
workflows:
test:
jobs:
- 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"]