Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Jenkins configuration #34

Merged
merged 3 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .jenkins/debian-12.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ FROM debian:12

LABEL org.opencontainers.image.source="https://github.com/marco-compiler/marco-runtime"

ARG LLVM_PARALLEL_COMPILE_JOBS=4
ARG LLVM_PARALLEL_LINK_JOBS=1
ARG LLVM_BUILD_TYPE=Release
ARG LLVM_ENABLE_ASSERTIONS=OFF

# Install compilation dependencies.
RUN apt update -y && \
apt install -y build-essential gfortran ninja-build lld mold cmake ccache \
Expand All @@ -17,6 +12,11 @@ COPY ./setup_venv.sh /tmp/
RUN chmod +x /tmp/setup_venv.sh && /tmp/setup_venv.sh

# Install LLVM.
ARG LLVM_PARALLEL_COMPILE_JOBS=4
ARG LLVM_PARALLEL_LINK_JOBS=1
ARG LLVM_BUILD_TYPE=Release
ARG LLVM_ENABLE_ASSERTIONS=OFF

COPY ./version_llvm.txt /tmp/
COPY ./install_llvm.sh /tmp/

Expand Down
37 changes: 14 additions & 23 deletions .jenkins/dev-debian-12.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
String configName = "debian-12"
String dockerfile = "debian-12.Dockerfile"
String checkName = "ci-" + configName

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

node {
agent {
Expand Down Expand Up @@ -36,37 +33,31 @@ node {
" -f " + runtimeSrcPath + "/.jenkins/" + dockerfile +
" " + runtimeSrcPath + "/.jenkins";

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

def dockerImage

stage("Docker image") {
dockerImage = docker.build(dockerRuntimeImageName + ':' + env.GIT_COMMIT, dockerArgs)
}

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

stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}
stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}

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

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

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

publishChecks(name: checkName, conclusion: 'SUCCESS', summary: 'Completed')
}
37 changes: 14 additions & 23 deletions .jenkins/dev-fedora-40.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
String configName = "fedora-40"
String dockerfile = "fedora-40.Dockerfile"
String checkName = "ci-" + configName

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

node {
agent {
Expand Down Expand Up @@ -36,37 +33,31 @@ node {
" -f " + runtimeSrcPath + "/.jenkins/" + dockerfile +
" " + runtimeSrcPath + "/.jenkins";

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

def dockerImage

stage("Docker image") {
dockerImage = docker.build(dockerRuntimeImageName + ':' + env.GIT_COMMIT, dockerArgs)
}

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

stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}
stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}

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

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

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

publishChecks(name: checkName, conclusion: 'SUCCESS', summary: 'Completed')
}
37 changes: 14 additions & 23 deletions .jenkins/dev-ubuntu-22.04.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
String configName = "ubuntu-22.04"
String dockerfile = "ubuntu-22.04.Dockerfile"
String checkName = "ci-" + configName

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

node {
agent {
Expand Down Expand Up @@ -36,37 +33,31 @@ node {
" -f " + runtimeSrcPath + "/.jenkins/" + dockerfile +
" " + runtimeSrcPath + "/.jenkins";

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

def dockerImage

stage("Docker image") {
dockerImage = docker.build(dockerRuntimeImageName + ':' + env.GIT_COMMIT, dockerArgs)
}

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

stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}
stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}

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

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

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

publishChecks(name: checkName, conclusion: 'SUCCESS', summary: 'Completed')
}
10 changes: 2 additions & 8 deletions .jenkins/docker-dev-debug-debian-12.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
String configName = "debian-12"
String dockerfile = "debian-12.Dockerfile"
String checkName = "docker-dev-debug-image"

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

node {
agent {
Expand Down Expand Up @@ -37,8 +34,6 @@ node {
" -f " + runtimeSrcPath + "/.jenkins/" + dockerfile +
" " + runtimeSrcPath + "/.jenkins";

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

def dockerImage

stage('Build') {
Expand All @@ -48,13 +43,12 @@ node {
docker.withRegistry('https://ghcr.io', 'marco-ci') {
stage('Publish') {
dockerImage.push()
dockerImage.push("latest")

if (tag != "") {
dockerImage.push(tag)
}

dockerImage.push("latest")
}
}

publishChecks(name: checkName, conclusion: 'SUCCESS', summary: 'Completed')
}
10 changes: 2 additions & 8 deletions .jenkins/docker-dev-release-debian-12.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
String configName = "debian-12"
String dockerfile = "debian-12.Dockerfile"
String checkName = "docker-dev-release-image"

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

node {
agent {
Expand Down Expand Up @@ -37,8 +34,6 @@ node {
" -f " + runtimeSrcPath + "/.jenkins/" + dockerfile +
" " + runtimeSrcPath + "/.jenkins";

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

def dockerImage

stage('Build') {
Expand All @@ -48,13 +43,12 @@ node {
docker.withRegistry('https://ghcr.io', 'marco-ci') {
stage('Publish') {
dockerImage.push()
dockerImage.push("latest")

if (tag != "") {
dockerImage.push(tag)
}

dockerImage.push("latest")
}
}

publishChecks(name: checkName, conclusion: 'SUCCESS', summary: 'Completed')
}
10 changes: 5 additions & 5 deletions .jenkins/fedora-40.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ FROM fedora:40

LABEL org.opencontainers.image.source="https://github.com/marco-compiler/marco-runtime"

ARG LLVM_PARALLEL_COMPILE_JOBS=4
ARG LLVM_PARALLEL_LINK_JOBS=1
ARG LLVM_BUILD_TYPE=Release
ARG LLVM_ENABLE_ASSERTIONS=OFF

# Install compilation dependencies.
RUN dnf update -y && \
dnf install -y gcc gcc-c++ gfortran perl ninja-build mold cmake ccache \
Expand All @@ -17,6 +12,11 @@ COPY ./setup_venv.sh /tmp/
RUN chmod +x /tmp/setup_venv.sh && /tmp/setup_venv.sh

# Install LLVM.
ARG LLVM_PARALLEL_COMPILE_JOBS=4
ARG LLVM_PARALLEL_LINK_JOBS=1
ARG LLVM_BUILD_TYPE=Release
ARG LLVM_ENABLE_ASSERTIONS=OFF

COPY ./version_llvm.txt /tmp/
COPY ./install_llvm.sh /tmp/

Expand Down
35 changes: 13 additions & 22 deletions .jenkins/package-debian-12.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
String configName = "debian-12"
String dockerfile = "debian-12.Dockerfile"
String checkName = "package-debian-12"

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

node {
agent {
Expand Down Expand Up @@ -35,36 +32,30 @@ node {
" -f " + runtimeSrcPath + "/.jenkins/" + dockerfile +
" " + runtimeSrcPath + "/.jenkins";

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

def dockerImage

stage('Docker image') {
dockerImage = docker.build(dockerRuntimeImageName + ':latest', dockerArgs)
}

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

stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}
stage('Configure') {
cmake arguments: "-S " + runtimeSrcPath + " -B " + runtimeBuildPath + " -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_LINKER_TYPE=MOLD -DCMAKE_INSTALL_PREFIX=" + runtimeInstallPath, installation: 'InSearchPath', label: 'Configure'
}

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

stage('Package') {
sh "chmod +x " + runtimeSrcPath + "/.jenkins/package/" + configName + "/build.sh"
sh runtimeSrcPath + "/.jenkins/package/" + configName + "/build.sh " + runtimeSrcPath + " " + runtimeInstallPath
stage('Package') {
sh "chmod +x " + runtimeSrcPath + "/.jenkins/package/" + configName + "/build.sh"
sh runtimeSrcPath + "/.jenkins/package/" + configName + "/build.sh " + runtimeSrcPath + " " + runtimeInstallPath

sshPublisher(publishers: [sshPublisherDesc(configName: 'marco-package', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: configName + "/amd64", remoteDirectorySDF: false, sourceFiles: '*.deb')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
sshPublisher(publishers: [sshPublisherDesc(configName: 'marco-package', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: configName + "/amd64", remoteDirectorySDF: false, sourceFiles: '*.deb')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}

publishChecks(name: checkName, conclusion: 'SUCCESS', summary: 'Completed')
}
10 changes: 5 additions & 5 deletions .jenkins/ubuntu-22.04.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ FROM ubuntu:22.04

LABEL org.opencontainers.image.source="https://github.com/marco-compiler/marco-runtime"

ARG LLVM_PARALLEL_COMPILE_JOBS=4
ARG LLVM_PARALLEL_LINK_JOBS=1
ARG LLVM_BUILD_TYPE=Release
ARG LLVM_ENABLE_ASSERTIONS=OFF

# Install compilation dependencies.
RUN apt update -y && \
apt install -y build-essential gfortran ninja-build lld mold cmake ccache \
Expand All @@ -17,6 +12,11 @@ COPY ./setup_venv.sh /tmp/
RUN chmod +x /tmp/setup_venv.sh && /tmp/setup_venv.sh

# Install LLVM.
ARG LLVM_PARALLEL_COMPILE_JOBS=4
ARG LLVM_PARALLEL_LINK_JOBS=1
ARG LLVM_BUILD_TYPE=Release
ARG LLVM_ENABLE_ASSERTIONS=OFF

COPY ./version_llvm.txt /tmp/
COPY ./install_llvm.sh /tmp/

Expand Down
Loading