All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m58s
Build / Build Components (push) Successful in 2m17s
Pre-commit hooks / Pre-commit (push) Successful in 2m24s
OCI image / Build container images (push) Successful in 4m48s
Tests and linters / gopls check (push) Successful in 4m44s
Tests and linters / Run gofumpt (push) Successful in 5m1s
Tests and linters / Tests with -race (push) Successful in 5m25s
Tests and linters / Lint (push) Successful in 5m36s
Tests and linters / Staticcheck (push) Successful in 5m37s
Tests and linters / Tests (push) Successful in 5m48s
This commit introduces Jenkins pipeline that duplicates the features of existing Forgejo Actions workflows. Change-Id: I657a6c27373a1ed4736ae27b4fb660e0ac86012d Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
81 lines
1.9 KiB
Groovy
81 lines
1.9 KiB
Groovy
def golang = ['1.23', '1.24']
|
|
def golangDefault = "golang:${golang.last()}"
|
|
|
|
async {
|
|
|
|
for (version in golang) {
|
|
def go = version
|
|
|
|
task("test/go${go}") {
|
|
container("golang:${go}") {
|
|
sh 'make test'
|
|
}
|
|
}
|
|
|
|
task("build/go${go}") {
|
|
container("golang:${go}") {
|
|
for (app in ['cli', 'node', 'ir', 'adm', 'lens']) {
|
|
sh """
|
|
make bin/frostfs-${app}
|
|
bin/frostfs-${app} --version
|
|
"""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
task('test/race') {
|
|
container(golangDefault) {
|
|
sh 'make test GOFLAGS="-count=1 -race"'
|
|
}
|
|
}
|
|
|
|
task('lint') {
|
|
container(golangDefault) {
|
|
sh 'make lint-install lint'
|
|
}
|
|
}
|
|
|
|
task('staticcheck') {
|
|
container(golangDefault) {
|
|
sh 'make staticcheck-install staticcheck-run'
|
|
}
|
|
}
|
|
|
|
task('gopls') {
|
|
container(golangDefault) {
|
|
sh 'make gopls-install gopls-run'
|
|
}
|
|
}
|
|
|
|
task('gofumpt') {
|
|
container(golangDefault) {
|
|
sh '''
|
|
make fumpt-install
|
|
make fumpt
|
|
git diff --exit-code --quiet
|
|
'''
|
|
}
|
|
}
|
|
|
|
task('vulncheck') {
|
|
container(golangDefault) {
|
|
sh '''
|
|
go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
govulncheck ./...
|
|
'''
|
|
}
|
|
}
|
|
|
|
task('pre-commit') {
|
|
sh '''
|
|
apt update
|
|
apt install -y --no-install-recommends pre-commit
|
|
''' // TODO: Make an OCI image for pre-commit + golang? Unpack golang tarball with a library function?
|
|
withEnv(['SKIP=make-lint,go-staticcheck-repo-mod,go-unit-tests,gofumpt']) {
|
|
sh 'pre-commit run --color=always --hook-stage=manual --all-files'
|
|
}
|
|
}
|
|
}
|
|
|
|
// TODO: dco check
|