forked from The-OpenROAD-Project/OpenROAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: move timeouts closer to running test
Signed-off-by: Vitor Bandeira <[email protected]>
- Loading branch information
Vitor Bandeira
committed
Nov 21, 2024
1 parent
7c8114b
commit fde52dc
Showing
3 changed files
with
61 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
@Library('[email protected]') _ | ||
|
||
timeout(time: 2, unit: 'HOURS') { | ||
node { | ||
node { | ||
|
||
stage('Checkout'){ | ||
checkout scm; | ||
} | ||
stage('Checkout'){ | ||
checkout scm; | ||
} | ||
|
||
def DOCKER_IMAGE; | ||
stage('Build and Push Docker Image') { | ||
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad'); | ||
echo "Docker image is ${DOCKER_IMAGE}"; | ||
} | ||
def DOCKER_IMAGE; | ||
stage('Build and Push Docker Image') { | ||
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad'); | ||
echo "Docker image is ${DOCKER_IMAGE}"; | ||
} | ||
|
||
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 -no-warnings -coverage'; | ||
} | ||
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 -no-warnings -coverage'; | ||
} | ||
} | ||
|
||
stage('Dynamic Code Coverage') { | ||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { | ||
stage('Dynamic Code Coverage') { | ||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { | ||
timeout(time: 2, unit: 'HOURS') { | ||
sh './etc/CodeCoverage.sh dynamic'; | ||
} | ||
} | ||
|
||
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(); | ||
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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
@Library('[email protected]') _ | ||
|
||
timeout(time: 2, unit: 'HOURS') { | ||
node { | ||
node { | ||
|
||
stage('Checkout'){ | ||
checkout scm; | ||
} | ||
stage('Checkout'){ | ||
checkout scm; | ||
} | ||
|
||
def DOCKER_IMAGE; | ||
stage('Build and Push Docker Image') { | ||
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad'); | ||
echo "Docker image is ${DOCKER_IMAGE}"; | ||
} | ||
def DOCKER_IMAGE; | ||
stage('Build and Push Docker Image') { | ||
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad'); | ||
echo "Docker image is ${DOCKER_IMAGE}"; | ||
} | ||
|
||
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /home/jenkins/cov-latest:/root/cov-latest') { | ||
stage("Setup") { | ||
sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; | ||
} | ||
stage('Run Static Code Coverage') { | ||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { | ||
withCredentials([string(credentialsId: 'COVERITY_TOKEN', variable: 'TOKEN')]) { | ||
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /home/jenkins/cov-latest:/root/cov-latest') { | ||
stage("Setup") { | ||
sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; | ||
} | ||
stage('Run Static Code Coverage') { | ||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { | ||
withCredentials([string(credentialsId: 'COVERITY_TOKEN', variable: 'TOKEN')]) { | ||
timeout(time: 2, unit: 'HOURS') { | ||
sh label: 'CodeCoverage Script', script: ''' | ||
export PATH=/root/cov-latest/bin:$PATH | ||
./etc/CodeCoverage.sh static ${TOKEN} | ||
'''; | ||
} | ||
} | ||
archiveArtifacts artifacts: 'openroad.tgz'; | ||
} | ||
archiveArtifacts artifacts: 'openroad.tgz'; | ||
} | ||
} | ||
|
||
stage('Send Email Report') { | ||
sendEmail(); | ||
} | ||
|
||
stage('Send Email Report') { | ||
sendEmail(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters