81 lines
2.3 KiB
Groovy
81 lines
2.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'
|
|
PIP_DISABLE_PIP_VERSION_CHECK = '1'
|
|
}
|
|
|
|
stages {
|
|
stage('Checkout') {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
stage('Check tools') {
|
|
steps {
|
|
sh 'python3 --version && git --version'
|
|
}
|
|
}
|
|
stage('Set up Python tools') {
|
|
steps {
|
|
sh '''
|
|
python3 -m venv .venv
|
|
.venv/bin/python -m pip install -r requirements-ci.txt
|
|
python3 -m venv .venv-app
|
|
.venv-app/bin/python -m pip install setuptools==80.9.0
|
|
.venv-app/bin/python -m pip install --no-build-isolation --no-deps .
|
|
'''
|
|
}
|
|
}
|
|
stage('Dependency vulnerability audit') {
|
|
steps {
|
|
sh '.venv/bin/pip-audit --strict .'
|
|
}
|
|
}
|
|
stage('Dependency license policy') {
|
|
steps {
|
|
sh '.venv/bin/pip-licenses --python=.venv-app/bin/python'
|
|
}
|
|
}
|
|
stage('Unit tests and coverage') {
|
|
steps {
|
|
sh '''
|
|
.venv/bin/coverage erase
|
|
.venv/bin/coverage run -m unittest discover -s tests -v
|
|
.venv/bin/coverage report
|
|
.venv/bin/coverage xml
|
|
'''
|
|
}
|
|
}
|
|
stage('Ravenous clone test') {
|
|
when { expression { params.RUN_CLONE_TEST } }
|
|
steps {
|
|
sh 'python3 -m unittest discover -s integration -v'
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
success {
|
|
echo 'repo-fix audit, license policy, coverage, and tests passed.'
|
|
}
|
|
failure {
|
|
echo 'repo-fix CI failed; check the audit, policy, coverage, and test stages above.'
|
|
}
|
|
}
|
|
}
|