diff --git a/jenkins/public_tests_all.Jenkinsfile b/jenkins/public_tests_all.Jenkinsfile index 2c747b1c3d..56cb05a369 100644 --- a/jenkins/public_tests_all.Jenkinsfile +++ b/jenkins/public_tests_all.Jenkinsfile @@ -1,68 +1,29 @@ -@Library('utils@main') _ +@Library('utils@orfs-v2.0.1') _ -node { +node('ubuntu22') { - properties([ - copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME), - ]); + properties([copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME)]); stage('Checkout') { checkout scm; } - def commitHash = "none"; - def DOCKER_IMAGE_TAG = "latest"; + def DOCKER_IMAGE; stage('Build and Push Docker Image') { - if (isDependencyInstallerChanged(env.BRANCH_NAME)) { - commitHash = sh(script: 'git rev-parse HEAD', returnStdout: true); - commitHash = commitHash.replaceAll(/[^a-zA-Z0-9-]/, ''); - DOCKER_IMAGE_TAG = pushCIImage(env.BRANCH_NAME, commitHash); - } + DOCKER_IMAGE = dockerPush('ubuntu22.04', 'orfs'); + echo "Docker image is $DOCKER_IMAGE"; } - def DOCKER_IMAGE = "openroad/flow-ubuntu22.04-dev:${DOCKER_IMAGE_TAG}"; - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { - stage('Build ORFS and Stash bins') { - sh "git config --system --add safe.directory '*'"; - localBuild(); - } + stage('Build ORFS and Stash bins') { + buildBins(DOCKER_IMAGE); } stage('Run Tests') { - Map tasks = [failFast: false]; - def test_slugs = getTestSlugs("all"); - for (test in test_slugs) { - def currentSlug = test; // copy needed to correctly pass args to runTests - tasks["${test}"] = { - node { - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { - sh "git config --system --add safe.directory '*'"; - checkout scm; - runTests(currentSlug); - } - } - } - } - } - parallel(tasks); + runTests(DOCKER_IMAGE, 'pr'); } - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { - sh "git config --system --add safe.directory '*'"; - stage('Report Summary') { - generateReportShortSummary(); - } - stage("Report HTML Table") { - generateReportHtmlTable(); - } - stage('Upload Metadata') { - uploadMetadata(env.BRANCH_NAME, commitHash); - } - stage('Send Report') { - def COMMIT_AUTHOR_EMAIL = sh(script: "git --no-pager show -s --format='%ae'", returnStdout: true).trim(); - sendEmail(env.BRANCH_NAME, COMMIT_AUTHOR_EMAIL); - } + stage ('Cleanup and Reporting') { + finalReport(DOCKER_IMAGE); } } diff --git a/jenkins/public_tests_small.Jenkinsfile b/jenkins/public_tests_small.Jenkinsfile deleted file mode 100644 index c48ecb3a61..0000000000 --- a/jenkins/public_tests_small.Jenkinsfile +++ /dev/null @@ -1,68 +0,0 @@ -@Library('utils@main') _ - -node { - - properties([ - copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME), - ]); - - stage('Checkout') { - checkout scm; - } - - def commitHash = "none"; - def DOCKER_IMAGE_TAG = "latest"; - stage('Build and Push Docker Image') { - if (isDependencyInstallerChanged(env.BRANCH_NAME)) { - commitHash = sh(script: 'git rev-parse HEAD', returnStdout: true); - commitHash = commitHash.replaceAll(/[^a-zA-Z0-9-]/, ''); - DOCKER_IMAGE_TAG = pushCIImage(env.BRANCH_NAME, commitHash); - } - } - def DOCKER_IMAGE = "openroad/flow-ubuntu22.04-dev:${DOCKER_IMAGE_TAG}"; - - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { - stage('Build ORFS and Stash bins') { - sh "git config --system --add safe.directory '*'"; - localBuild(); - } - } - - stage('Run Tests') { - Map tasks = [failFast: false]; - def test_slugs = getTestSlugs("small"); - for (test in test_slugs) { - def currentSlug = test; // copy needed to correctly pass args to runTests - tasks["${test}"] = { - node { - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { - sh "git config --system --add safe.directory '*'"; - checkout scm; - runTests(currentSlug); - } - } - } - } - } - parallel(tasks); - } - - docker.image("${DOCKER_IMAGE}").inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { - sh "git config --system --add safe.directory '*'"; - stage('Report Summary') { - generateReportShortSummary(); - } - stage("Report HTML Table") { - generateReportHtmlTable(); - } - stage('Upload Metadata') { - uploadMetadata(env.BRANCH_NAME, commitHash); - } - stage('Send Report') { - def COMMIT_AUTHOR_EMAIL = sh(script: "git --no-pager show -s --format='%ae'", returnStdout: true).trim(); - sendEmail(env.BRANCH_NAME, COMMIT_AUTHOR_EMAIL); - } - } - -}