Skip to content

Commit

Permalink
ci: coverage uses docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Bandeira <[email protected]>
  • Loading branch information
Vitor Bandeira committed Jul 8, 2024
1 parent 1f003ac commit 707ade6
Showing 1 changed file with 33 additions and 23 deletions.
56 changes: 33 additions & 23 deletions jenkins/Jenkinsfile.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,49 @@

timeout(time: 1, unit: 'HOURS') {
node {

stage('Checkout'){
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
checkout scm;
}

stage('Build for Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh label: 'Build OpenROAD', script: './etc/Build.sh -coverage';
}
def DOCKER_IMAGE;
stage('Build and Push Docker Image') {
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
echo "Docker image is ${DOCKER_IMAGE}";
}

stage('Dynamic Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh './etc/CodeCoverage.sh dynamic';
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
stage('Build for Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh label: 'Build OpenROAD', script: './etc/Build.sh -coverage';
}
}
}

stage('Publish Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: 'coverage-output',
reportFiles: 'index.html',
reportName: 'Dynamic Code Coverage',
reportTitles: ''
]);
stage('Dynamic Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh './etc/CodeCoverage.sh dynamic';
}
}
}

stage('Send Email Report') {
sendEmail();
stage('Publish Code Coverage') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: 'coverage-output',
reportFiles: 'index.html',
reportName: 'Dynamic Code Coverage',
reportTitles: ''
]);
}
}
}

}

/* stage('Send Email Report') { */
/* sendEmail(); */
/* } */

}

0 comments on commit 707ade6

Please sign in to comment.