client_golang/.circleci/config.yml

64 lines
1.6 KiB
YAML
Raw Permalink Normal View History

version: 2.1
orbs:
go: circleci/go@1.7.1
prometheus: prometheus/prometheus@0.16.0
jobs:
test:
parameters:
go_version:
type: string
run_style_and_unused:
type: boolean
default: false
run_lint:
type: boolean
default: false
use_gomod_cache:
type: boolean
default: true
docker:
- image: cimg/go:<< parameters.go_version >>
steps:
- checkout
- when:
condition: << parameters.use_gomod_cache >>
steps:
- go/load-cache:
key: v1-go<< parameters.go_version >>
- run: make check_license test
- when:
condition: << parameters.run_lint >>
steps:
- run: make lint
- when:
condition: << parameters.run_style_and_unused >>
steps:
- run: make style unused
- when:
condition: << parameters.use_gomod_cache >>
steps:
- go/save-cache:
key: v1-go<< parameters.go_version >>
- store_test_results:
path: test-results
workflows:
version: 2
client_golang:
jobs:
# Refer to README.md for the currently supported versions.
- test:
name: go-1-17
go_version: "1.17"
run_lint: true
- test:
name: go-1-18
go_version: "1.18"
run_lint: true
- test:
name: go-1-19
go_version: "1.19"
run_lint: true
# Style and unused/missing packages are only checked against
# the latest supported Go version.
run_style_and_unused: true