Skip to content

Commit

Permalink
Use separate Jenkinfiles for different configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuttari committed Sep 18, 2024
1 parent 18adbfb commit 5b4a2ef
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 96 deletions.
75 changes: 75 additions & 0 deletions .jenkins/dev-debian-12.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
String configName = "debian-12"
String dockerfile = "Debian.Dockerfile"

publishChecks(name: configName, status: 'QUEUED', summary: 'Queued')

node {
agent 'x86_64-ubuntu-22.04'

String localWorkspace = "${WORKSPACE}/" + configName

String srcPath = localWorkspace + "/src"
String buildPath = localWorkspace + "/build"
String installPath = localWorkspace + "/install"

String marcoSrcPath = srcPath + "/marco"
String marcoBuildPath = buildPath + "/marco"
String marcoInstallPath = installPath + "/marco"

stage("Checkout") {
dir(marcoSrcPath) {
def scmVars = checkout(scm)
env.GIT_COMMIT = scmVars.GIT_COMMIT
}
}

String dockerMARCOImageName = 'marco-compiler/marco-' + "dev-" + configName

String dockerArgs =
" --build-arg VERSION=12" +
" --build-arg LLVM_BUILD_TYPE=Release" +
" --build-arg LLVM_PARALLEL_COMPILE_JOBS=${LLVM_PARALLEL_COMPILE_JOBS}" +
" --build-arg LLVM_PARALLEL_LINK_JOBS=${LLVM_PARALLEL_LINK_JOBS}" +
" -f " + marcoSrcPath + "/.jenkins/" + dockerfile +
" " + marcoSrcPath + "/.jenkins";

publishChecks(name: configName, status: 'IN_PROGRESS', summary: 'In progress')

def dockerImage

stage("Docker image") {
dockerImage = docker.build(
dockerMARCOImageName + ':' + env.GIT_COMMIT,
"--build-arg MARCO_RUNTIME_BUILD_TYPE=Debug --build-arg LLVM_ENABLE_ASSERTIONS=ON " + dockerArgs)
}

dockerImage.inside() {
withChecks(name: configName) {
stage("OS information") {
sh "cat /etc/os-release"
}

stage('Configure') {
cmake arguments: "-S " + marcoSrcPath + " -B " + marcoBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=" + marcoInstallPath + " -DLLVM_EXTERNAL_LIT=/virtualenv/bin/lit", installation: 'InSearchPath', label: 'Configure'
}

stage('Build') {
cmake arguments: "--build " + marcoBuildPath, installation: 'InSearchPath', label: 'Build'
}

stage('Unit test') {
cmake arguments: "--build " + marcoBuildPath + " --target test", installation: 'InSearchPath', label: 'Unit tests'
}

stage('Regression test') {
cmake arguments: "--build " + marcoBuildPath + " --target check", installation: 'InSearchPath', label: 'Regression tests'
}

stage('Install') {
cmake arguments: "--build " + marcoBuildPath + " --target install", installation: 'InSearchPath', label: 'Install'
}
}
}

publishChecks(name: configName, conclusion: 'SUCCESS', summary: 'Completed')
}
75 changes: 75 additions & 0 deletions .jenkins/dev-fedora-40.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
String configName = "fedora-40"
String dockerfile = "Fedora.Dockerfile"

publishChecks(name: configName, status: 'QUEUED', summary: 'Queued')

node {
agent 'x86_64-ubuntu-22.04'

String localWorkspace = "${WORKSPACE}/" + configName

String srcPath = localWorkspace + "/src"
String buildPath = localWorkspace + "/build"
String installPath = localWorkspace + "/install"

String marcoSrcPath = srcPath + "/marco"
String marcoBuildPath = buildPath + "/marco"
String marcoInstallPath = installPath + "/marco"

stage("Checkout") {
dir(marcoSrcPath) {
def scmVars = checkout(scm)
env.GIT_COMMIT = scmVars.GIT_COMMIT
}
}

String dockerMARCOImageName = 'marco-compiler/marco-' + "dev-" + configName

String dockerArgs =
" --build-arg VERSION=40" +
" --build-arg LLVM_BUILD_TYPE=Release" +
" --build-arg LLVM_PARALLEL_COMPILE_JOBS=${LLVM_PARALLEL_COMPILE_JOBS}" +
" --build-arg LLVM_PARALLEL_LINK_JOBS=${LLVM_PARALLEL_LINK_JOBS}" +
" -f " + marcoSrcPath + "/.jenkins/" + dockerfile +
" " + marcoSrcPath + "/.jenkins";

publishChecks(name: configName, status: 'IN_PROGRESS', summary: 'In progress')

def dockerImage

stage("Docker image") {
dockerImage = docker.build(
dockerMARCOImageName + ':' + env.GIT_COMMIT,
"--build-arg MARCO_RUNTIME_BUILD_TYPE=Debug --build-arg LLVM_ENABLE_ASSERTIONS=ON " + dockerArgs)
}

dockerImage.inside() {
withChecks(name: configName) {
stage("OS information") {
sh "cat /etc/os-release"
}

stage('Configure') {
cmake arguments: "-S " + marcoSrcPath + " -B " + marcoBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=" + marcoInstallPath + " -DLLVM_EXTERNAL_LIT=/virtualenv/bin/lit", installation: 'InSearchPath', label: 'Configure'
}

stage('Build') {
cmake arguments: "--build " + marcoBuildPath, installation: 'InSearchPath', label: 'Build'
}

stage('Unit test') {
cmake arguments: "--build " + marcoBuildPath + " --target test", installation: 'InSearchPath', label: 'Unit tests'
}

stage('Regression test') {
cmake arguments: "--build " + marcoBuildPath + " --target check", installation: 'InSearchPath', label: 'Regression tests'
}

stage('Install') {
cmake arguments: "--build " + marcoBuildPath + " --target install", installation: 'InSearchPath', label: 'Install'
}
}
}

publishChecks(name: configName, conclusion: 'SUCCESS', summary: 'Completed')
}
75 changes: 75 additions & 0 deletions .jenkins/dev-ubuntu-22.04.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
String configName = "ubuntu-22.04"
String dockerfile = "Ubuntu.Dockerfile"

publishChecks(name: configName, status: 'QUEUED', summary: 'Queued')

node {
agent 'x86_64-ubuntu-22.04'

String localWorkspace = "${WORKSPACE}/" + configName

String srcPath = localWorkspace + "/src"
String buildPath = localWorkspace + "/build"
String installPath = localWorkspace + "/install"

String marcoSrcPath = srcPath + "/marco"
String marcoBuildPath = buildPath + "/marco"
String marcoInstallPath = installPath + "/marco"

stage("Checkout") {
dir(marcoSrcPath) {
def scmVars = checkout(scm)
env.GIT_COMMIT = scmVars.GIT_COMMIT
}
}

String dockerMARCOImageName = 'marco-compiler/marco-' + "dev-" + configName

String dockerArgs =
" --build-arg VERSION=22.04" +
" --build-arg LLVM_BUILD_TYPE=Release" +
" --build-arg LLVM_PARALLEL_COMPILE_JOBS=${LLVM_PARALLEL_COMPILE_JOBS}" +
" --build-arg LLVM_PARALLEL_LINK_JOBS=${LLVM_PARALLEL_LINK_JOBS}" +
" -f " + marcoSrcPath + "/.jenkins/" + dockerfile +
" " + marcoSrcPath + "/.jenkins";

publishChecks(name: configName, status: 'IN_PROGRESS', summary: 'In progress')

def dockerImage

stage("Docker image") {
dockerImage = docker.build(
dockerMARCOImageName + ':' + env.GIT_COMMIT,
"--build-arg MARCO_RUNTIME_BUILD_TYPE=Debug --build-arg LLVM_ENABLE_ASSERTIONS=ON " + dockerArgs)
}

dockerImage.inside() {
withChecks(name: configName) {
stage("OS information") {
sh "cat /etc/os-release"
}

stage('Configure') {
cmake arguments: "-S " + marcoSrcPath + " -B " + marcoBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=" + marcoInstallPath + " -DLLVM_EXTERNAL_LIT=/virtualenv/bin/lit", installation: 'InSearchPath', label: 'Configure'
}

stage('Build') {
cmake arguments: "--build " + marcoBuildPath, installation: 'InSearchPath', label: 'Build'
}

stage('Unit test') {
cmake arguments: "--build " + marcoBuildPath + " --target test", installation: 'InSearchPath', label: 'Unit tests'
}

stage('Regression test') {
cmake arguments: "--build " + marcoBuildPath + " --target check", installation: 'InSearchPath', label: 'Regression tests'
}

stage('Install') {
cmake arguments: "--build " + marcoBuildPath + " --target install", installation: 'InSearchPath', label: 'Install'
}
}
}

publishChecks(name: configName, conclusion: 'SUCCESS', summary: 'Completed')
}
96 changes: 0 additions & 96 deletions Jenkinsfile

This file was deleted.

0 comments on commit 5b4a2ef

Please sign in to comment.