2020-02-28 12:39:51 +03:00
|
|
|
version: 2.1
|
|
|
|
orbs:
|
2022-03-17 18:34:12 +03:00
|
|
|
go: circleci/go@1.7.1
|
2022-03-16 22:50:22 +03:00
|
|
|
prometheus: prometheus/prometheus@0.16.0
|
2020-02-28 12:39:51 +03:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
parameters:
|
|
|
|
go_version:
|
|
|
|
type: string
|
2020-10-15 18:56:09 +03:00
|
|
|
run_style_and_unused:
|
2020-02-28 12:39:51 +03:00
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
run_lint:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
use_gomod_cache:
|
|
|
|
type: boolean
|
|
|
|
default: true
|
|
|
|
docker:
|
2022-03-17 18:34:12 +03:00
|
|
|
- image: cimg/go:<< parameters.go_version >>
|
2020-02-28 12:39:51 +03:00
|
|
|
steps:
|
2021-03-31 03:01:21 +03:00
|
|
|
- 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
|
2020-02-28 12:39:51 +03:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
client_golang:
|
|
|
|
jobs:
|
2021-03-31 03:01:21 +03:00
|
|
|
# Refer to README.md for the currently supported versions.
|
2022-03-17 18:34:12 +03:00
|
|
|
- test:
|
|
|
|
name: go-1-18
|
|
|
|
go_version: "1.18"
|
|
|
|
run_lint: true
|
2022-11-08 02:14:19 +03:00
|
|
|
- test:
|
|
|
|
name: go-1-19
|
|
|
|
go_version: "1.19"
|
|
|
|
run_lint: true
|
2023-03-21 16:46:37 +03:00
|
|
|
- test:
|
|
|
|
name: go-1-20
|
|
|
|
go_version: "1.20"
|
|
|
|
run_lint: true
|
2022-03-17 18:34:12 +03:00
|
|
|
# Style and unused/missing packages are only checked against
|
|
|
|
# the latest supported Go version.
|
2021-03-31 03:01:21 +03:00
|
|
|
run_style_and_unused: true
|