forked from mirror/client_golang
Run check for unused/missing Go packages only against latest Go version
The tidied up `go.mod` file tends to change between Go versions. Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
e6ea98bdda
commit
3d1759b4c6
|
@ -9,7 +9,7 @@ jobs:
|
||||||
parameters:
|
parameters:
|
||||||
go_version:
|
go_version:
|
||||||
type: string
|
type: string
|
||||||
run_style:
|
run_style_and_unused:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
run_lint:
|
run_lint:
|
||||||
|
@ -28,15 +28,15 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- go/load-cache:
|
- go/load-cache:
|
||||||
key: v1-go<< parameters.go_version >>
|
key: v1-go<< parameters.go_version >>
|
||||||
- run: make check_license unused test
|
- run: make check_license test
|
||||||
- when:
|
- when:
|
||||||
condition: << parameters.run_lint >>
|
condition: << parameters.run_lint >>
|
||||||
steps:
|
steps:
|
||||||
- run: make lint
|
- run: make lint
|
||||||
- when:
|
- when:
|
||||||
condition: << parameters.run_style >>
|
condition: << parameters.run_style_and_unused >>
|
||||||
steps:
|
steps:
|
||||||
- run: make style
|
- run: make style unused
|
||||||
- when:
|
- when:
|
||||||
condition: << parameters.use_gomod_cache >>
|
condition: << parameters.use_gomod_cache >>
|
||||||
steps:
|
steps:
|
||||||
|
@ -78,5 +78,6 @@ workflows:
|
||||||
name: go-1-15
|
name: go-1-15
|
||||||
go_version: "1.15"
|
go_version: "1.15"
|
||||||
run_lint: true
|
run_lint: true
|
||||||
# Style is only checked against the latest supported Go version.
|
# Style and unused/missing packages are only checked against
|
||||||
run_style: true
|
# the latest supported Go version.
|
||||||
|
run_style_and_unused: true
|
||||||
|
|
Loading…
Reference in New Issue