From 35bffc8a0b58006baf209efe03b23b517f7de380 Mon Sep 17 00:00:00 2001 From: Andil Date: Mon, 24 Aug 2026 18:51:03 +0000 Subject: [PATCH] ci: publish coverage reports in Jenkins --- Jenkinsfile | 62 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cfde467..96c842d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -174,19 +174,38 @@ pipeline { } post { - always { - junit( - testResults: 'backend/test-results/*.xml', - allowEmptyResults: true - ) + always { + junit( + testResults: 'backend/test-results/*.xml', + allowEmptyResults: true + ) - archiveArtifacts( - artifacts: 'backend/coverage/**', - fingerprint: true, - allowEmptyArchive: true - ) - } - } + recordCoverage( + tools: [[ + parser: 'LCOV', + pattern: 'backend/coverage/lcov.info' + ]], + sourceCodeRetention: 'EVERY_BUILD', + id: 'backend-coverage', + name: 'Backend Coverage' + ) + + publishHTML([ + allowMissing: true, + alwaysLinkToLastBuild: true, + keepAll: true, + reportDir: 'backend/coverage', + reportFiles: 'index.html', + reportName: 'Backend Coverage HTML' + ]) + + archiveArtifacts( + artifacts: 'backend/coverage/**', + fingerprint: true, + allowEmptyArchive: true + ) + } +} } stage('Frontend - Lint, Tests et Build') { @@ -225,6 +244,25 @@ pipeline { allowEmptyResults: true ) + recordCoverage( + tools: [[ + parser: 'LCOV', + pattern: 'frontend/coverage/lcov.info' + ]], + sourceCodeRetention: 'EVERY_BUILD', + id: 'frontend-coverage', + name: 'Frontend Coverage' + ) + + publishHTML([ + allowMissing: true, + alwaysLinkToLastBuild: true, + keepAll: true, + reportDir: 'frontend/coverage', + reportFiles: 'index.html', + reportName: 'Frontend Coverage HTML' + ]) + archiveArtifacts( artifacts: 'frontend/coverage/**', fingerprint: true,