From 397540c1b1a9dc12ce9e65bcce7e7668f330fca9 Mon Sep 17 00:00:00 2001 From: Matthieu 'JP' DERASSE Date: Mon, 1 Aug 2022 20:43:07 +0000 Subject: [PATCH] feat(ci): Add Jenkinsfile as a POC --- Jenkinsfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..247ebf3 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,41 @@ +pipeline { + agent any + tools { + go 'go1.18.5' + } + stages { + stage('Pre Test') { + steps { + echo 'Installing dependencies' + sh 'go version' + sh 'go install golang.org/x/lint/golint@latest' + } + } + + stage('Build') { + steps { + echo 'Compiling and building' + sh 'go build' + } + } + + stage('Lint') { + steps { + echo 'Running vetting' + sh 'go vet ./...' + echo 'Running linting' + sh 'golint ./...' + } + } + + stage('Unit-Test') { + steps { + echo 'Run All unit test' + sh 'go test -cover ./...' + } + } + + } + post { + } +} \ No newline at end of file