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:
beorn7 2020-10-15 17:56:09 +02:00
parent e6ea98bdda
commit 3d1759b4c6
1 changed files with 7 additions and 6 deletions

View File

@ -9,7 +9,7 @@ jobs:
parameters:
go_version:
type: string
run_style:
run_style_and_unused:
type: boolean
default: false
run_lint:
@ -28,15 +28,15 @@ jobs:
steps:
- go/load-cache:
key: v1-go<< parameters.go_version >>
- run: make check_license unused test
- run: make check_license test
- when:
condition: << parameters.run_lint >>
steps:
- run: make lint
- when:
condition: << parameters.run_style >>
condition: << parameters.run_style_and_unused >>
steps:
- run: make style
- run: make style unused
- when:
condition: << parameters.use_gomod_cache >>
steps:
@ -78,5 +78,6 @@ workflows:
name: go-1-15
go_version: "1.15"
run_lint: true
# Style is only checked against the latest supported Go version.
run_style: true
# Style and unused/missing packages are only checked against
# the latest supported Go version.
run_style_and_unused: true