reportist/Jenkinsfile

104 lines
2.9 KiB
Groovy

// Add this webhook in Gitea:
// http://192.168.1.37:8080/gitea-webhook/post
pipeline {
agent { label 'rust_no_docker' }
options { disableConcurrentBuilds() }
environment {
CARGO_TERM_COLOR = 'always'
// Reserved for future generated CI artifacts.
CI_ARTIFACT_DIR = '.ci-artifacts'
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Validate Repository') {
steps {
sh '''
set -eu
echo "Validating Reportist repository..."
test -f README.md
test -f LICENSE
test -f AGENT.md
echo "Repository structure OK."
'''
}
}
stage('Validate Contract') {
steps {
sh '''
set -eu
command -v uv >/dev/null 2>&1 || { echo "uv is required for the isolated validation environment" >&2; exit 1; }
uv venv --python 3.11 --allow-existing .ci-venv
uv pip sync --python .ci-venv/bin/python requirements.txt
.ci-venv/bin/python --version
command -v typst >/dev/null 2>&1 || { echo "Typst is required for renderer tests" >&2; exit 1; }
typst --version
make test
'''
}
}
/*
* No deployment stage is currently intended.
*
* Reportist is a renderer/tool, not the owner of published
* Beffroi reports.
*/
}
post {
success {
publishChecks(
conclusion: 'SUCCESS',
name: 'Reportist CI',
summary: 'Reportist passed all currently implemented CI checks.',
text: 'Schema validation, generic PDF rendering, branding, pagination, asset safety, and standalone-copy checks passed.',
title: 'Reportist CI passed'
)
echo '✅ Reportist CI passed.'
}
failure {
publishChecks(
conclusion: 'FAILURE',
name: 'Reportist CI',
summary: 'Reportist failed CI.',
text: 'A repository or validation check failed. Check the Jenkins log.',
title: 'Reportist CI failed'
)
echo '❌ Reportist CI failed.'
}
unstable {
publishChecks(
conclusion: 'ACTION_REQUIRED',
name: 'Reportist CI',
summary: 'Reportist CI is unstable.',
text: 'The Jenkins build completed with an unstable status.',
title: 'Reportist CI unstable'
)
echo '⚠️ Reportist CI is unstable.'
}
always {
echo 'CI finished.'
}
}
}