Skip to content

Commit

Permalink
Merge pull request #592 from COVESA/ubuntu-ci
Browse files Browse the repository at this point in the history
CI for ubuntu 22 and 24
  • Loading branch information
hannesa2 authored Nov 24, 2024
2 parents cc1edd8 + 56efcec commit a719809
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/BuildPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,23 @@ jobs:
name: DLTViewer-linux-x86_64
path: build/dist/DLTViewer*.tgz

buildUbuntu22and24:
name: Build ${{ matrix.ubuntu }}
strategy:
matrix:
ubuntu: [ ubuntu-22.04, ubuntu-24.04 ]
runs-on: ${{ matrix.ubuntu }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: install build environment
run: scripts/linux/installUbuntu22and24.sh
- name: Build project
run: scripts/linux/buildUbuntu22and24.sh

buildWindows:
name: Build Windows
strategy:
Expand Down
32 changes: 32 additions & 0 deletions scripts/linux/buildUbuntu22and24.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -ex

SRC_DIR=$(pwd)
BUILD_DIR="${SRC_DIR}/build"
INSTALL_DIR="${BUILD_DIR}/install"
APP_DIR_NAME="DLTViewer"

NPROC=$(nproc)
echo Nb of cpus: ${NPROC}

echo Cleanup
rm -rf "${APP_DIR_NAME}"
rm -rf "${INSTALL_DIR}"
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"

echo Build with CMake
cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DCMAKE_BUILD_TYPE=Release \
-DDLT_USE_QT_RPATH=ON \
-DDLT_PARSER=OFF \
-DDLT_APP_DIR_NAME=${APP_DIR_NAME} \
-DDLT_LIBRARY_INSTALLATION_PATH="${APP_DIR_NAME}/usr/lib" \
-DDLT_EXECUTABLE_INSTALLATION_PATH="${APP_DIR_NAME}/usr/bin" \
-DDLT_RESOURCE_INSTALLATION_PATH="${APP_DIR_NAME}/usr/share" \
-DDLT_PLUGIN_INSTALLATION_PATH="${APP_DIR_NAME}/usr/bin/plugins" \
"${SRC_DIR}"

cmake --build "${BUILD_DIR}" -j ${NPROC} -v
20 changes: 20 additions & 0 deletions scripts/linux/installUbuntu22and24.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -ex

id
env
pwd

UBUNTU_VERSION=$(lsb_release -rs)
QT_PACKAGES=""
# for ubuntu 22 install QT 5, for ubuntu 24 install QT 6
if [ "$UBUNTU_VERSION" = "22.04" ]; then
QT_PACKAGES="qtbase5-dev libqt5serialport5-dev"
else
QT_PACKAGES="qt6-base-dev libqt6serialport6-dev"
fi

sudo apt update
sudo apt-get install -y --no-install-recommends ninja-build ${QT_PACKAGES}

g++ --version

0 comments on commit a719809

Please sign in to comment.