Skip to content

Commit b0e2b4e

Browse files
committed
ci: delegate coverage/coverity/nightly to k8s shared-library pipelines
Signed-off-by: Joao Luis Sombrio <sombrio@sombrasoft.dev>
1 parent 22ecee6 commit b0e2b4e

3 files changed

Lines changed: 9 additions & 181 deletions

File tree

jenkins/Jenkinsfile.coverage

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,5 @@
1-
@Library('utils@or-v2.0.1') _
2-
3-
node {
4-
5-
stage('Checkout'){
6-
checkout scm;
7-
}
8-
9-
def DOCKER_IMAGE;
10-
stage('Build and Push Docker Image') {
11-
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
12-
echo "Docker image is ${DOCKER_IMAGE}";
13-
}
14-
15-
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
16-
stage('Build for Coverage') {
17-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
18-
sh label: 'Build OpenROAD', script: './etc/Build.sh -no-warnings -coverage';
19-
}
20-
}
21-
22-
stage('Dynamic Code Coverage') {
23-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
24-
timeout(time: 3, unit: 'HOURS') {
25-
sh './etc/CodeCoverage.sh dynamic';
26-
}
27-
}
28-
}
29-
30-
stage('Publish Code Coverage') {
31-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
32-
publishHTML([
33-
allowMissing: false,
34-
alwaysLinkToLastBuild: false,
35-
keepAll: false,
36-
reportDir: 'coverage-output',
37-
reportFiles: 'index.html',
38-
reportName: 'Dynamic Code Coverage',
39-
reportTitles: ''
40-
]);
41-
}
42-
}
43-
44-
stage('Save Artifacts') {
45-
sh label: "Save code coverage results", script: "find . -name results -type d -exec tar zcvf code-coverage.tgz {} '+'";
46-
archiveArtifacts artifacts: "code-coverage.tgz";
47-
}
48-
49-
}
50-
51-
stage('Send Email Report') {
52-
sendEmail();
53-
}
1+
@Library('utils@main') _
542

3+
k8sPodTemplate(coordinator: true, cloud: utilPickCloud()) {
4+
pipelineORCoverage(k8s: true)
555
}

jenkins/Jenkinsfile.coverity

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,5 @@
1-
@Library('utils@or-v2.0.1') _
2-
3-
node {
4-
5-
stage('Checkout'){
6-
checkout scm;
7-
}
8-
9-
def DOCKER_IMAGE;
10-
stage('Build and Push Docker Image') {
11-
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
12-
echo "Docker image is ${DOCKER_IMAGE}";
13-
}
14-
15-
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') {
16-
stage("Setup") {
17-
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
18-
}
19-
stage('Run Static Code Coverage') {
20-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
21-
withCredentials([string(credentialsId: 'COVERITY_TOKEN', variable: 'TOKEN')]) {
22-
timeout(time: 2, unit: 'HOURS') {
23-
sh label: 'CodeCoverage Script', script: '''
24-
export PATH=/root/cov-latest/bin:$PATH
25-
./etc/CodeCoverage.sh static ${TOKEN}
26-
''';
27-
}
28-
}
29-
}
30-
archiveArtifacts artifacts: 'openroad.tgz';
31-
}
32-
}
33-
34-
stage('Send Email Report') {
35-
sendEmail();
36-
}
1+
@Library('utils@main') _
372

3+
k8sPodTemplate(coordinator: true, cloud: utilPickCloud()) {
4+
pipelineORCoverity(k8s: true)
385
}

jenkins/Jenkinsfile.nightly

Lines changed: 3 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,5 @@
1-
@Library('utils@or-v2.0.1') _
2-
3-
node {
4-
5-
env.EQUIVALENCE_CHECK = 1;
6-
7-
stage('Checkout'){
8-
checkout scm;
9-
}
10-
11-
def DOCKER_IMAGE;
12-
stage('Build and Push Docker Image') {
13-
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'openroad');
14-
echo "Docker image is ${DOCKER_IMAGE}";
15-
}
16-
17-
stage('Build and Stash bins') {
18-
buildBinsOR(DOCKER_IMAGE, "-no-warnings");
19-
}
20-
21-
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
22-
stage('Setup Build') {
23-
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
24-
}
25-
stage('Build OpenROAD') {
26-
sh label: 'Build script', script: './etc/Build.sh -no-warnings';
27-
stash name: 'build', includes: "build/**";
28-
}
29-
}
30-
31-
stage('Nightly Tests') {
32-
33-
Map tasks = [failFast: false];
34-
def ISPD_YEAR = ['18', '19'];
35-
def TEST_TO_RUN = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'];
36-
ISPD_YEAR.each { ispd_year ->
37-
TEST_TO_RUN.each { test_to_run ->
38-
def name = "ISPD ${ispd_year} TEST ${test_to_run}";
39-
tasks[name] = {
40-
node {
41-
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /home/jenkins/ispd:/root/ispd') {
42-
stage("Setup ${name}") {
43-
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
44-
checkout scm;
45-
unstash 'build';
46-
}
47-
stage("Run ${name}") {
48-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
49-
timeout(time: 8, unit: 'HOURS') {
50-
sh "python3 src/drt/test/run-ispd.py --program ${WORKSPACE}/build/bin/openroad --tests ispd${ispd_year}_test${test_to_run}";
51-
}
52-
}
53-
}
54-
stage("Save ${name} Results") {
55-
archiveArtifacts "**/*.tar.gz, **/*.log";
56-
}
57-
}
58-
}
59-
}
60-
}
61-
}
62-
63-
tasks['GPL Tests'] = {
64-
node {
65-
docker.image(DOCKER_IMAGE).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') {
66-
stage('Setup GPL Tests') {
67-
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
68-
checkout scm;
69-
unstash 'build';
70-
}
71-
stage('Run GPL Tests') {
72-
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
73-
timeout(time: 2, unit: 'HOURS') {
74-
sh './src/gpl/test/regression-large';
75-
}
76-
}
77-
}
78-
stage('Save GPL Results') {
79-
sh label: 'Save gpl results', script: "exec tar zcvf src/gpl/test/results.tgz src/gpl/test/results";
80-
archiveArtifacts "**/*.tar.gz, **/*.log";
81-
}
82-
}
83-
}
84-
}
85-
86-
parallel(tasks)
87-
88-
}
89-
90-
stage('Send Email Report') {
91-
sendEmail();
92-
}
1+
@Library('utils@main') _
932

3+
k8sPodTemplate(coordinator: true, cloud: utilPickCloud()) {
4+
pipelineORNightly(k8s: true)
945
}

0 commit comments

Comments
 (0)