repo-fix/Jenkinsfile

50 lines
1.3 KiB
Groovy

// Optional Gitea webhook: http://192.168.1.37:8080/gitea-webhook/post
pipeline {
agent { label 'rust_no_docker' }
options {
skipDefaultCheckout(true)
timeout(time: 10, unit: 'MINUTES')
disableConcurrentBuilds()
}
parameters {
booleanParam(name: 'RUN_CLONE_TEST', defaultValue: true,
description: 'Test URL repair on a temporary Ravenous clone (requires Gitea access).')
}
environment {
GIT_TERMINAL_PROMPT = '0'
PYTHONUNBUFFERED = '1'
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Check tools') {
steps {
sh 'python3 --version && git --version'
}
}
stage('Unit tests') {
steps {
sh 'python3 -m unittest discover -s tests -v'
}
}
stage('Ravenous clone test') {
when { expression { params.RUN_CLONE_TEST } }
steps {
sh 'python3 -m unittest discover -s integration -v'
}
}
}
post {
success { echo 'repo-fix tests passed.' }
failure { echo 'repo-fix tests failed; see the test output above.' }
}
}