Skip to content

Include Golang CI lint tekton pipeline #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .tekton/nbde-tang-server-golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
kind: Pipeline
apiVersion: tekton.dev/v1
metadata:
name: golangci-lint
spec:
params: [ ]
tasks:
- name: clone-and-ci-lint
taskSpec:
volumes:
- name: source
emptyDir: { }
steps:
- image: docker.io/library/golang:1.23.2
env:
- name: URL
valueFrom:
fieldRef:
fieldPath: metadata.annotations['pac.test.appstudio.openshift.io/source-repo-url']
- name: REVISION
valueFrom:
fieldRef:
fieldPath: metadata.annotations['pac.test.appstudio.openshift.io/sha']
computeResources:
limits:
cpu: 8
memory: 4Gi
requests:
cpu: 500m
memory: 1Gi
volumeMounts:
- name: source
mountPath: /workspace
script: |
#!/bin/bash
set -ex
if [ -z "$URL" ] || [ -z "$REVISION" ]; then
echo "URL and REVISION not set ... no component?"
exit 0
fi
echo "Initializing the env vars"
echo "URL: $URL"
echo "REVISION: $REVISION"
mkdir /workspace/source
cd /workspace/source
git init
git remote add origin $URL
git fetch origin $REVISION
git checkout FETCH_HEAD
git log -1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint -v run --timeout 5m0s ./...
exit $? # exit with the status of the tests