|
1 | | -@Library('utils@main') _ |
| 1 | +@Library('utils@orfs-v2.0.1') _ |
2 | 2 |
|
3 | | -node { |
| 3 | +node('ubuntu22') { |
4 | 4 |
|
5 | | - properties([ |
6 | | - copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME), |
7 | | - ]); |
| 5 | + properties([copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME)]); |
8 | 6 |
|
9 | 7 | stage('Checkout') { |
10 | 8 | checkout scm; |
11 | 9 | } |
12 | 10 |
|
13 | | - def commitHash = "none"; |
14 | | - def DOCKER_IMAGE_TAG = "latest"; |
| 11 | + def DOCKER_IMAGE; |
15 | 12 | stage('Build and Push Docker Image') { |
16 | | - if (isDependencyInstallerChanged(env.BRANCH_NAME)) { |
17 | | - commitHash = sh(script: 'git rev-parse HEAD', returnStdout: true); |
18 | | - commitHash = commitHash.replaceAll(/[^a-zA-Z0-9-]/, ''); |
19 | | - DOCKER_IMAGE_TAG = pushCIImage(env.BRANCH_NAME, commitHash); |
20 | | - } |
| 13 | + DOCKER_IMAGE = dockerPush('ubuntu22.04', 'orfs'); |
| 14 | + echo "Docker image is $DOCKER_IMAGE"; |
21 | 15 | } |
22 | | - def DOCKER_IMAGE = "openroad/flow-ubuntu22.04-dev:${DOCKER_IMAGE_TAG}"; |
23 | 16 |
|
24 | | - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { |
25 | | - stage('Build ORFS and Stash bins') { |
26 | | - sh "git config --system --add safe.directory '*'"; |
27 | | - localBuild(); |
28 | | - } |
| 17 | + stage('Build ORFS and Stash bins') { |
| 18 | + buildBins(DOCKER_IMAGE); |
29 | 19 | } |
30 | 20 |
|
31 | 21 | stage('Run Tests') { |
32 | | - Map tasks = [failFast: false]; |
33 | | - def test_slugs = getTestSlugs("all"); |
34 | | - for (test in test_slugs) { |
35 | | - def currentSlug = test; // copy needed to correctly pass args to runTests |
36 | | - tasks["${test}"] = { |
37 | | - node { |
38 | | - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { |
39 | | - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { |
40 | | - sh "git config --system --add safe.directory '*'"; |
41 | | - checkout scm; |
42 | | - runTests(currentSlug); |
43 | | - } |
44 | | - } |
45 | | - } |
46 | | - } |
47 | | - } |
48 | | - parallel(tasks); |
| 22 | + runTests(DOCKER_IMAGE, 'pr'); |
49 | 23 | } |
50 | 24 |
|
51 | | - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { |
52 | | - sh "git config --system --add safe.directory '*'"; |
53 | | - stage('Report Summary') { |
54 | | - generateReportShortSummary(); |
55 | | - } |
56 | | - stage("Report HTML Table") { |
57 | | - generateReportHtmlTable(); |
58 | | - } |
59 | | - stage('Upload Metadata') { |
60 | | - uploadMetadata(env.BRANCH_NAME, commitHash); |
61 | | - } |
62 | | - stage('Send Report') { |
63 | | - def COMMIT_AUTHOR_EMAIL = sh(script: "git --no-pager show -s --format='%ae'", returnStdout: true).trim(); |
64 | | - sendEmail(env.BRANCH_NAME, COMMIT_AUTHOR_EMAIL); |
65 | | - } |
| 25 | + stage ('Cleanup and Reporting') { |
| 26 | + finalReport(DOCKER_IMAGE); |
66 | 27 | } |
67 | 28 |
|
68 | 29 | } |
0 commit comments