reportist/Jenkinsfile

73 lines
2.2 KiB
Groovy

pipeline {
agent { label 'rust_no_docker' }
options {
disableConcurrentBuilds()
skipDefaultCheckout(true)
}
stages {
stage('Checkout') {
steps { checkout scm }
}
stage('Validate Repository') {
steps {
sh '''
set -eu
test -f README.md
test -f LICENSE
test -f Makefile
test -f schema/report.schema.json
test -x tools/render.sh
test -x tools/validate.sh
command -v make >/dev/null 2>&1
command -v jq >/dev/null 2>&1
command -v typst >/dev/null 2>&1
command -v uv >/dev/null 2>&1
jq --version
typst --version
uv --version
'''
}
}
stage('Test') {
steps { sh 'make test' }
}
}
post {
success {
publishChecks(
conclusion: 'SUCCESS',
name: 'Reportist CI',
summary: 'All report validation and rendering checks passed.',
text: 'Contracts, YAML and JSON input, branding, assets, pagination, and standalone rendering passed.',
title: 'Reportist CI passed'
)
echo '✅ Reportist CI passed.'
}
failure {
publishChecks(
conclusion: 'FAILURE',
name: 'Reportist CI',
summary: 'A validation or rendering check failed.',
text: 'Review the Jenkins log for the failing contract, asset, Typst, or PDF check.',
title: 'Reportist CI failed'
)
echo '❌ Reportist CI failed.'
}
unstable {
publishChecks(
conclusion: 'ACTION_REQUIRED',
name: 'Reportist CI',
summary: 'The Reportist build is unstable.',
text: 'Review the Jenkins log for unstable checks.',
title: 'Reportist CI unstable'
)
echo '⚠️ Reportist CI is unstable.'
}
}
}