-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a Task to run `golangci-lint` on the repository. This is part of the dogfooding effort on tektoncd/pipeline. Signed-off-by: Vincent Demeester <[email protected]>
- Loading branch information
1 parent
412c748
commit a259af0
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: PipelineResource | ||
metadata: | ||
name: tekton-pipelines | ||
spec: | ||
type: git | ||
params: | ||
- name: url | ||
value: https://github.com/tektoncd/pipeline # REPLACE with your own fork | ||
- name: revision | ||
value: master # REPLACE with your own commit | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: TaskRun | ||
metadata: | ||
name: golangci-lint-run | ||
spec: | ||
taskRef: | ||
name: golangci-lint | ||
inputs: | ||
params: | ||
- name: flags | ||
value: --verbose | ||
resources: | ||
- name: source | ||
resourceRef: | ||
name: tekton-pipelines | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Task | ||
metadata: | ||
name: golangci-lint | ||
spec: | ||
inputs: | ||
params: | ||
- name: package | ||
description: package (and its children) under test | ||
default: github.com/tektoncd/pipeline | ||
- name: flags | ||
description: flags to use for the test command | ||
- name: version | ||
description: golangci-lint version to use | ||
default: v1.16 | ||
resources: | ||
- name: source | ||
type: git | ||
targetPath: src/${inputs.params.package} | ||
steps: | ||
- name: lint | ||
image: golangci/golangci-lint:${inputs.params.version} | ||
workingdir: /workspace/src/${inputs.params.package} | ||
command: | ||
- /bin/bash | ||
args: | ||
- -c | ||
- "golangci-lint run ${inputs.params.flags}" | ||
env: | ||
- name: GOPATH | ||
value: /workspace | ||
|