ci: align renderer checks with portable runtime
Reportist CI All report validation and rendering checks passed.
Beffroi/reportist/pipeline/head This commit looks good Details

This commit is contained in:
Dandaedre 2026-09-16 00:52:51 +02:00
parent ee00bb3df9
commit 006382e695
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
2 changed files with 24 additions and 56 deletions

77
Jenkinsfile vendored
View File

@ -1,62 +1,40 @@
// 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'
options {
disableConcurrentBuilds()
skipDefaultCheckout(true)
}
stages {
stage('Checkout') {
steps {
checkout scm
}
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; }
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
make test
uv --version
'''
}
}
/*
* No deployment stage is currently intended.
*
* Reportist is a renderer/tool, not the owner of published
* Beffroi reports.
*/
stage('Test') {
steps { sh 'make test' }
}
}
post {
@ -64,40 +42,31 @@ pipeline {
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.',
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: 'Reportist failed CI.',
text: 'A repository or validation check failed. Check the Jenkins log.',
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: 'Reportist CI is unstable.',
text: 'The Jenkins build completed with an unstable status.',
summary: 'The Reportist build is unstable.',
text: 'Review the Jenkins log for unstable checks.',
title: 'Reportist CI unstable'
)
echo '⚠️ Reportist CI is unstable.'
}
always {
echo 'CI finished.'
}
}
}

View File

@ -22,7 +22,7 @@ input=$(realpath "$input")
[[ -f "$input" ]] || fail "$input: report does not exist"
"$root/tools/validate.sh" "$input" >/dev/null || fail "invalid report"
if [[ -z "$output" ]]; then output=${input%.*}.pdf; fi
output=$(realpath -m "$output")
output_parent=$(dirname "$output"); mkdir -p "$output_parent"; output=$(cd "$output_parent" && pwd -P)/$(basename "$output")
[[ "$input" != "$output" ]] || fail "input and output paths must differ"
if [[ -e "$output" && "$force" == false ]]; then fail "$output: output exists; use --force to replace it"; fi
@ -51,7 +51,6 @@ if [[ "$logo" != null ]]; then
cp -- "$cursor" "$stage/$logo"
fi
mkdir -p "$(dirname "$output")"
if ! "$typst_command" compile --root "$stage" --input "report=report.$format" --input "format=$format" \
"$stage/report.typ" "$stage/report.pdf"; then
fail "invalid report or Typst rendering failed"