Skip to content

Commit

Permalink
tekton task to run linting
Browse files Browse the repository at this point in the history
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
vdemeester committed Jun 11, 2019
1 parent 412c748 commit a259af0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tekton/ci-lint-run.yaml
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

32 changes: 32 additions & 0 deletions tekton/ci-lint.yaml
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

0 comments on commit a259af0

Please sign in to comment.