1- pipeline {
2- agent any;
3- environment {
4- MAKE_ISSUE = 1;
5- }
6- options {
7- copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME);
8- }
9- stages {
1+ 102
11- stage("Checkout master branch") {
12- steps {
3+ node {
4+
5+ properties([copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME)]);
6+
7+ stage('Checkout ORFS') {
8+ checkout([
9+ $class: 'GitSCM',
10+ branches: [[name: scm.branches[0].name]],
11+ doGenerateSubmoduleConfigurations: false,
12+ extensions: [
13+ [$class: 'CloneOption', noTags: false],
14+ [$class: 'SubmoduleOption', recursiveSubmodules: true]
15+ ],
16+ submoduleCfg: [],
17+ userRemoteConfigs: scm.userRemoteConfigs
18+ ]);
19+ def description = sh(script: "git log -1 --pretty=%B", returnStdout: true).trim();
20+ if (description.contains('ci') && description.contains('skip')) {
21+ currentBuild.result = 'SKIPPED'; // 'SUCCESS', 'SKIPPED'
22+ return;
23+ }
24+ }
25+
26+
27+ stage('Checkout OpenROAD Latest') {
1328 checkout([$class: "GitSCM",
1429 branches: [[name: "*/master"]],
1530 doGenerateSubmoduleConfigurations: false,
@@ -27,219 +42,29 @@ pipeline {
2742 relativeTargetDir: "tools/OpenROAD"
2843 ]
2944 ]
30- ])
31- }
45+ ]);
3246 }
3347
34- stage('Build Local') {
35- steps {
36- sh "./build_openroad.sh --local --no_init --latest";
37- stash name: "install", includes: "tools/install/**";
38- }
39- post {
40- always {
41- catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
42- archiveArtifacts artifacts: "build_openroad.log";
43- }
44- }
45- }
48+ def DOCKER_IMAGE;
49+ stage('Build and Push Docker Image') {
50+ DOCKER_IMAGE = dockerPush('ubuntu22.04', 'orfs');
51+ echo "Docker image is $DOCKER_IMAGE";
4652 }
4753
48- stage('Tests') {
49- matrix {
50- axes {
51- axis {
52- name 'TEST_SLUG';
53- values "docker build",
54- "aes asap7",
55- "aes-mbff asap7",
56- "aes_lvt asap7",
57- "ethmac asap7",
58- "ethmac_lvt asap7",
59- "gcd asap7",
60- "gcd-ccs asap7",
61- "ibex asap7",
62- "jpeg asap7",
63- "jpeg_lvt asap7",
64- "riscv32i asap7",
65- "riscv32i-mock-sram asap7",
66- "riscv32i-mock-sram/fakeram7_256x32 asap7",
67- "swerv_wrapper asap7",
68- "uart asap7",
69- "mock-array asap7",
70- "mock-cpu asap7",
71- "mock-alu asap7",
72- "aes-block asap7",
73- "aes nangate45",
74- "ariane136 nangate45",
75- "black_parrot nangate45",
76- "bp_be_top nangate45",
77- "bp_fe_top nangate45",
78- "bp_multi_top nangate45",
79- "dynamic_node nangate45",
80- "gcd nangate45",
81- "ibex nangate45",
82- "jpeg nangate45",
83- "swerv nangate45",
84- "swerv_wrapper nangate45",
85- "tinyRocket nangate45",
86- "aes sky130hd",
87- "chameleon sky130hd",
88- "gcd sky130hd",
89- "ibex sky130hd",
90- "jpeg sky130hd",
91- "microwatt sky130hd",
92- "riscv32i sky130hd",
93- "aes sky130hs",
94- "gcd sky130hs",
95- "ibex sky130hs",
96- "jpeg sky130hs",
97- "riscv32i sky130hs",
98- "aes gf180",
99- "aes-hybrid gf180",
100- "ibex gf180",
101- "jpeg gf180",
102- "riscv32i gf180",
103- "uart-blocks gf180",
104- "aes ihp-sg13g2",
105- "ibex ihp-sg13g2",
106- "gcd ihp-sg13g2",
107- "spi ihp-sg13g2",
108- "riscv32i ihp-sg13g2";
109- }
110- }
111-
112- stages {
113- stage('Test') {
114- options {
115- timeout(time: 6, unit: "HOURS");
116- }
117- agent any;
118- steps {
119- unstash "install";
120- script {
121- stage("${TEST_SLUG}") {
122- catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
123- if ("${TEST_SLUG}" == 'docker build'){
124- retry(3) {
125- try {
126- sh "./build_openroad.sh --no_init --latest";
127- }
128- catch (e) {
129- sleep(60);
130- sh 'exit 1';
131- }
132- }
133- sh "docker run --rm openroad/flow-ubuntu22.04-builder:latest tools/install/OpenROAD/bin/openroad -help -exit";
134- sh "docker run --rm openroad/flow-ubuntu22.04-builder:latest bash -c 'source ./env.sh ; make -C flow'";
135- } else {
136- sh 'nice flow/test/test_helper.sh ${TEST_SLUG}';
137- }
138- }
139- }
140- }
141- }
142- post {
143- always {
144- catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
145- archiveArtifacts artifacts: "flow/*tar.gz", allowEmptyArchive: true, excludes: "**/4_eqy_output/**";
146- archiveArtifacts artifacts: "flow/logs/**/*, flow/reports/**/*", allowEmptyArchive: true, excludes: "**/4_eqy_output/**";
147- }
148- }
149- }
150- }
151- }
152- }
54+ stage('Build ORFS and Stash bins') {
55+ buildBins(DOCKER_IMAGE, '--local --no_init --latest');
15356 }
15457
155- stage("Report Short Summary") {
156- steps {
157- copyArtifacts filter: "flow/logs/**/*",
158- projectName: '${JOB_NAME}',
159- selector: specific('${BUILD_NUMBER}');
160- copyArtifacts filter: "flow/reports/**/*",
161- projectName: '${JOB_NAME}',
162- selector: specific('${BUILD_NUMBER}');
163- sh "flow/util/genReport.py -sv";
164- }
165- post {
166- always {
167- archiveArtifacts artifacts: "flow/reports/report-summary.log";
168- archiveArtifacts artifacts: "flow/reports/**/report*.log";
58+ stage('Run Tests') {
59+ if (env.CHANGE_BRANCH && env.CHANGE_BRANCH.contains('ci-dev')) {
60+ runTests(DOCKER_IMAGE, 'dev');
61+ } else {
62+ runTests(DOCKER_IMAGE, 'pr');
16963 }
170- }
17164 }
17265
173- stage("Report Summary") {
174- steps {
175- sh "flow/util/genReport.py -svv";
176- }
177- }
178-
179- stage("Report Full") {
180- steps {
181- sh "flow/util/genReport.py -vvvv";
182- }
183- }
184-
185- stage("Report HTML Table") {
186- steps {
187- sh "flow/util/genReportTable.py";
188- publishHTML([
189- allowMissing: true,
190- alwaysLinkToLastBuild: true,
191- keepAll: true,
192- reportName: "Report",
193- reportDir: "flow/reports",
194- reportFiles: "report-table.html,report-gallery*.html",
195- reportTitles: "Flow Report"
196- ]);
197- }
198- }
199-
200- stage('Upload Metadata') {
201- steps {
202- withCredentials([file(credentialsId: 'firebase-admin-svc', variable: 'db_cred')]) {
203- sh """
204- python3 flow/util/uploadMetadata.py \
205- --buildID ${env.BUILD_ID} \
206- --branchName nightly \
207- --commitSHA ${env.GIT_COMMIT}-dirty \
208- --jenkinsURL ${env.RUN_DISPLAY_URL} \
209- --pipelineID ${env.BUILD_TAG} \
210- --changeBranch ${env.CHANGE_BRANCH} \
211- """ + '--cred ${db_cred}'
212- }
213- }
214- }
215-
216- }
217-
218- post {
219- failure {
220- copyArtifacts filter: "flow/reports/report-summary.log",
221- projectName: '${JOB_NAME}',
222- selector: specific('${BUILD_NUMBER}');
223- script {
224- try {
225- COMMIT_AUTHOR_EMAIL = sh (returnStdout: true, script: "git --no-pager show -s --format='%ae'").trim();
226- echo("Nightly run: report to stakeholders and commit author.");
227- EMAIL_TO="$COMMIT_AUTHOR_EMAIL, \$DEFAULT_RECIPIENTS";
228- } catch (Exception e) {
229- echo "Exception occurred: " + e.toString();
230- EMAIL_TO="\$DEFAULT_RECIPIENTS";
231- }
232- emailext (
233- to: "$EMAIL_TO",
234- replyTo: "$EMAIL_TO",
235- subject: '$DEFAULT_SUBJECT',
236- body: '''
237- $DEFAULT_CONTENT
238- ${FILE,path="flow/reports/report-summary.log"}
239- ''',
240- )
241- }
66+ stage ('Cleanup and Reporting') {
67+ finalReport(DOCKER_IMAGE);
24268 }
243- }
24469
24570}
0 commit comments