-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
163b93c
commit fbda8ea
Showing
3 changed files
with
78 additions
and
0 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,22 @@ | ||
name: CMake | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
cmake: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install xvfb | ||
sudo apt-get install build-essential libgl1-mesa-dev libgstreamer-gl1.0-0 libpulse-dev \ | ||
libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ | ||
libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 \ | ||
libxcb-xinerama0 libxcb1 libxkbcommon-dev libxkbcommon-x11-0 libxcb-xkb-dev cmake | ||
sudo apt install qt6-base-dev qt6-svg-dev qtbase5-dev libqt5svg5 | ||
- name: Running our CMake flow. | ||
run: | | ||
scripts/cmake.sh |
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,46 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Run custom CMake build script which auto-downloads, | ||
# builds, and then uses the compiled code in an application. | ||
# sudo apt-get update | ||
# sudo apt-get install xvfb | ||
# sudo apt-get install build-essential libgl1-mesa-dev libgstreamer-gl1.0-0 libpulse-dev \ | ||
# libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ | ||
# libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 \ | ||
# libxcb-xinerama0 libxcb1 libxkbcommon-dev libxkbcommon-x11-0 libxcb-xkb-dev cmake | ||
# sudo apt install qt6-base-dev qt6-svg-dev qtbase5-dev libqt5svg5 | ||
|
||
set -eux pipefail | ||
|
||
scripts_home="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | ||
project_home="$(dirname "${scripts_home}")" | ||
build_dir="${project_home}/dist/build" | ||
|
||
mkdir -p "${build_dir}/"{qt5,qt6} | ||
|
||
# we xcb installed for our headless running, so exit if we don't have it | ||
if ! hash xvfb-run &>/dev/null; then | ||
>&2 echo "Do not have xvfb installed..." | ||
exit 1 | ||
fi | ||
|
||
# first, try Qt5 | ||
# NOTE: Since we're using `-e`, we need to specially | ||
# capture the error code immediately. | ||
export QT_QPA_PLATFORM=offscreen | ||
cd "${build_dir}/qt5" | ||
cmake ../../example/cmake -D QT_VERSION=Qt5 | ||
make -j | ||
timeout 1 xvfb-run -a ./testing || error_code=$? | ||
if [[ "${error_code}" != 124 ]]; then | ||
exit "${error_code}" | ||
fi | ||
|
||
# first, try Qt6 | ||
cd "${build_dir}/qt6" | ||
cmake ../../example/cmake -D QT_VERSION=Qt6 | ||
make -j | ||
timeout 1 xvfb-run -a ./testing || error_code=$? | ||
if [[ "${error_code}" != 124 ]]; then | ||
exit "${error_code}" | ||
fi |
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