-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CPP/CI): basic CI setup for linux cmake build
Linux dockerized build and AppDir generation for compilation errors Also added AppImage TODOs, basic setup for MacOS and Windows but they still need work to have at least validation running Temporary disable CPP windows/mac until limitations are addressed in a follow up commit Extra: add build configuration fixes for rest of the platforms closes: #5998
- Loading branch information
1 parent
5a1f0a3
commit 4029a39
Showing
17 changed files
with
342 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
APPDIR="$(dirname "$(readlink -f "${0}")")" | ||
export GST_PLUGIN_SCANNER="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" | ||
export GST_PLUGIN_PATH="${APPDIR}/usr/lib/gstreamer-1.0" | ||
export GST_PLUGIN_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0" | ||
export GST_PLUGIN_SYSTEM_PATH="${APPDIR}/usr/lib/gstreamer-1.0" | ||
export GST_PLUGIN_SYSTEM_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0" | ||
export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${LD_LIBRARY_PATH}" | ||
export QT_QPA_PLATFORM="xcb" | ||
|
||
DEFAULT_LANG=en_US.UTF-8 | ||
if [[ "$LANG" == "C.UTF-8" ]] | ||
then | ||
export LANG=$DEFAULT_LANG | ||
else | ||
export LANG="${VARIABLE:=$DEFAULT_LANG}" | ||
fi | ||
|
||
exec "${APPDIR}/usr/bin/status-desktop" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
library 'status-jenkins-lib@v1.3.4' | ||
|
||
pipeline { | ||
agent { | ||
dockerfile { | ||
label 'linux' | ||
dir 'ci/cpp' | ||
filename 'Dockerfile-linux' | ||
/* allows jenkins use cat and mounts '/dev/fuse' for linuxdeployqt */ | ||
args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse' | ||
} | ||
} | ||
|
||
parameters { | ||
booleanParam( | ||
name: 'RELEASE', | ||
description: 'Decides whether binaries are built with debug symbols.', | ||
defaultValue: params.RELEASE ?: false | ||
) | ||
} | ||
|
||
options { | ||
timestamps() | ||
/* Prevent Jenkins jobs from running forever */ | ||
timeout(time: 20, unit: 'MINUTES') | ||
/* manage how many builds we keep */ | ||
buildDiscarder(logRotator( | ||
numToKeepStr: '10', | ||
daysToKeepStr: '30', | ||
artifactNumToKeepStr: '3', | ||
)) | ||
} | ||
|
||
environment { | ||
TARGET = 'linux-cpp' | ||
/* Control output the filename */ | ||
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage')}" | ||
} | ||
|
||
// TODO: Move all stages to the Makefile as targets "*-linux-using-docker" | ||
stages { | ||
stage('CMake Build') { | ||
steps { | ||
sh "qt-cmake ${env.WORKSPACE} -G Ninja -B ${env.WORKSPACE}/build -DCMAKE_BUILD_TYPE=Release" | ||
sh "cmake --build ${env.WORKSPACE}/build" | ||
} | ||
} | ||
|
||
stage('Package') { | ||
steps { | ||
sh "linuxdeploy --plugin qt --executable=${env.WORKSPACE}/build/status-desktop --appdir ${env.WORKSPACE}/build/AppDir --desktop-file=${env.WORKSPACE}/status.desktop --icon-file=${env.WORKSPACE}/status.svg --custom-apprun=${env.WORKSPACE}/AppRun-cpp" | ||
sh "cmake --install ${env.WORKSPACE}/build --prefix=${env.WORKSPACE}/build/install" | ||
sh "cp ${env.WORKSPACE}/build/install/lib/* ${env.WORKSPACE}/build/AppDir/usr/lib/" | ||
// TODO enable after deploying appimage plugin in the corresponding docker | ||
//sh "linuxdeploy --appdir ${env.WORKSPACE}/build/AppDir --output=appimage" | ||
// sh "mkdir pkg && cp \"\$(find ${env.WORKSPACE}/build/AppDir -maxdepth 2 -type f -iname \"*.AppImage\")\" ${env.STATUS_CLIENT_APPIMAGE}" | ||
} | ||
} | ||
|
||
// TODO: enable after generating the AppImage | ||
// stage('Parallel Upload') { | ||
// parallel { | ||
// stage('Upload') { | ||
// steps { script { | ||
// env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_APPIMAGE) | ||
// jenkins.setBuildDesc(AppImage: env.PKG_URL) | ||
// } } | ||
// } | ||
// stage('Archive') { | ||
// steps { script { | ||
// archiveArtifacts("${env.STATUS_CLIENT_APPIMAGE}*") | ||
// } } | ||
// } | ||
// } | ||
// } | ||
} | ||
|
||
post { | ||
success { script { github.notifyPR(true) } } | ||
failure { script { github.notifyPR(false) } } | ||
always { cleanWs() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
library 'status-jenkins-lib@v1.3.4' | ||
|
||
pipeline { | ||
agent { | ||
docker { | ||
label 'linux' | ||
image 'stateoftheartio/qt6:6.3-macos-aqt' | ||
} | ||
} | ||
|
||
parameters { | ||
booleanParam( | ||
name: 'RELEASE', | ||
description: 'Decides whether binaries are built with debug symbols.', | ||
defaultValue: params.RELEASE ?: false | ||
) | ||
} | ||
|
||
options { | ||
timestamps() | ||
/* Prevent Jenkins jobs from running forever */ | ||
timeout(time: 20, unit: 'MINUTES') | ||
/* manage how many builds we keep */ | ||
buildDiscarder(logRotator( | ||
numToKeepStr: '10', | ||
daysToKeepStr: '30', | ||
artifactNumToKeepStr: '3', | ||
)) | ||
} | ||
|
||
environment { | ||
TARGET = 'macos-cpp' | ||
/* Control output the filename */ | ||
STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg')}" | ||
} | ||
|
||
// TODO: Move all stages to the Makefile as targets "*-mac-using-docker" | ||
stages { | ||
stage('CMake Build') { | ||
steps { | ||
sh "qt-cmake ${env.WORKSPACE} -G Ninja -B ${env.WORKSPACE}/build -DCMAKE_BUILD_TYPE=Release" | ||
sh "cmake --build ${env.WORKSPACE}/build" | ||
} | ||
} | ||
|
||
stage('Package') { | ||
steps { | ||
sh "macdeployqt ${env.WORKSPACE}/build/*.app -verbose=1 -dmg -qmldir=${env.WORKSPACE}" | ||
sh "mkdir pkg && cp \"\$(find ${env.WORKSPACE}/build -maxdepth 2 -type f -iname \"*.dmg\")\" ${env.STATUS_CLIENT_DMG}" | ||
} | ||
} | ||
|
||
stage('Parallel Upload') { | ||
parallel { | ||
stage('Upload') { | ||
steps { script { | ||
env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_DMG) | ||
jenkins.setBuildDesc(Dmg: env.PKG_URL) | ||
} } | ||
} | ||
stage('Archive') { | ||
steps { script { | ||
archiveArtifacts(env.STATUS_CLIENT_DMG) | ||
} } | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
success { script { github.notifyPR(true) } } | ||
failure { script { github.notifyPR(false) } } | ||
always { cleanWs() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
library 'status-jenkins-lib@v1.3.4' | ||
|
||
pipeline { | ||
agent { | ||
docker { | ||
label 'linux' | ||
image 'stateoftheartio/qt6:6.3-mingw-aqt' | ||
} | ||
} | ||
|
||
parameters { | ||
booleanParam( | ||
name: 'RELEASE', | ||
description: 'Decides whether binaries are built with debug symbols.', | ||
defaultValue: params.RELEASE ?: false | ||
) | ||
} | ||
|
||
options { | ||
timestamps() | ||
/* Prevent Jenkins jobs from running forever */ | ||
timeout(time: 20, unit: 'MINUTES') | ||
/* manage how many builds we keep */ | ||
buildDiscarder(logRotator( | ||
numToKeepStr: '10', | ||
daysToKeepStr: '30', | ||
artifactNumToKeepStr: '3', | ||
)) | ||
} | ||
|
||
environment { | ||
TARGET = 'windows-cpp' | ||
/* Control output the filename */ | ||
STATUS_CLIENT_ZIP = "pkg/${utils.pkgFilename(ext: 'zip')}" | ||
} | ||
|
||
// TODO: Move all stages to the Makefile as targets "*-windows-using-docker" | ||
stages { | ||
stage('CMake Build') { | ||
steps { | ||
sh "qt-cmake ${env.WORKSPACE} -G Ninja -B ${env.WORKSPACE}/build -DCMAKE_BUILD_TYPE=Release" | ||
sh "cmake --build ${env.WORKSPACE}/build" | ||
} | ||
} | ||
|
||
stage('Package') { | ||
steps { | ||
sh "windeployqt --qmldir ${env.WORKSPACE} --dir ${env.WORKSPACE}/build/deploy --libdir ${env.WORKSPACE}/build/deploy/libs --plugindir ${env.WORKSPACE}/build/deploy/plugins ${env.WORKSPACE}/build/*.exe" | ||
sh "zip -r ${STATUS_CLIENT_ZIP} build/deploy/" | ||
} | ||
} | ||
|
||
stage('Parallel Upload') { | ||
parallel { | ||
stage('Upload') { | ||
steps { script { | ||
exe_url = s3.uploadArtifact(env.STATUS_CLIENT_ZIP) | ||
env.PKG_URL = exe_url | ||
jenkins.setBuildDesc(Zip: zip_url, Exe: exe_url) | ||
} } | ||
} | ||
stage('Archive') { | ||
steps { script { | ||
archiveArtifacts(env.STATUS_CLIENT_ZIP) | ||
} } | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
success { script { github.notifyPR(true) } } | ||
failure { script { github.notifyPR(false) } } | ||
always { cleanWs() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM stateoftheartio/qt6:6.3-gcc-aqt | ||
|
||
RUN export DEBIAN_FRONTEND=noninteractive \ | ||
&& sudo apt update -yq \ | ||
&& sudo apt install -yq libgl-dev libvulkan-dev libxcb*-dev libxkbcommon-x11-dev | ||
|
||
# TODO finish installing dependencies then enable building the appimage in CI | ||
# RUN cd /tmp && git clone --single-branch --recursive https://github.com/AppImage/AppImageKit && cd AppImageKit/ && cmake -B ./build -S . | ||
# If still needed | ||
# RUN cd /tmp && git clone --single-branch --recursive https://github.com/linuxdeploy/linuxdeploy-plugin-appimage.git && cd AppImageKit/ && cmake -B ./build -S . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function(configure_app_os_specific TARGET_ARG URL_ORGANIZATION_NAME DOMAIN_ARG VERSION_MAJOR VERSION_MINOR VERSION_PATCH) | ||
# Noting here for now; helps simplifying main setup by removing platform if/else conditions | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,9 @@ target_link_libraries(${PROJECT_NAME} | |
Qt6::Quick | ||
Qt6::Qml | ||
) | ||
|
||
install( | ||
TARGETS | ||
${PROJECT_NAME} | ||
RUNTIME | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,9 @@ target_link_libraries(${PROJECT_NAME} | |
Qt6::Quick | ||
Qt6::Qml | ||
) | ||
|
||
install( | ||
TARGETS | ||
${PROJECT_NAME} | ||
RUNTIME | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.