Skip to content

Commit

Permalink
CI: Create CI presets
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Dec 26, 2023
1 parent a7a9684 commit f1a6274
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 55 deletions.
52 changes: 24 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ jobs:
- windows-latest
- macos-latest

build_type:
- Release

client_only:
- client_only
- client_and_ui

config:
- qt_major: 5
- preset: ci-dev-client-only-qt5
qt_version: "5.15"
- qt_major: 6

- preset: ci-dev-client-only-qt6
qt_version: "6.5.*"
qt_modules: qtshadertools qtscxml

- preset: ci-dev-client-and-ui-qt5
qt_version: "5.15"

- preset: ci-dev-client-and-ui-qt6
qt_version: "6.5.*"

steps:
- name: Install Qt with options and default aqtversion
uses: jurplel/install-qt-action@v3
Expand All @@ -58,15 +58,11 @@ jobs:

- name: Configure project
run: >
cmake -S . -B ./build -G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DGAMMARAY_CLIENT_ONLY_BUILD=${{ matrix.client_only == 'client_only' }}
cmake -S . -G Ninja --preset ${{ matrix.config.preset }}
-DGAMMARAY_BUILD_DOCS=${{ runner.os == 'Linux' }}
-DGAMMARAY_INSTALL_QT_LAYOUT=ON
-DGAMMARAY_MULTI_BUILD=OFF
- name: Build Project
run: cmake --build ./build
run: cmake --build ./build-${{ matrix.config.preset }}

- name: Install dependencies on Ubuntu
if: ${{ runner.os == 'Linux' }}
Expand All @@ -81,9 +77,9 @@ jobs:
# Exclude
# quickmaterialtest|quicktexturetest fails because of QT_QUICK_BACKEND=software
- name: Run tests on Linux Qt5 (offscreen)
if: ${{ runner.os == 'Linux' && matrix.config.qt_major == 5 }}
if: ${{ runner.os == 'Linux' && startsWith(matrix.config.qt_version, '5.') }}
run: >
ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
ctest --test-dir ./build-${{ matrix.config.preset }} -C 'Debug' --output-on-failure
--exclude-regex "quickmaterialtest|quicktexturetest|timertoptest"
env:
QT_QPA_PLATFORM: offscreen
Expand All @@ -94,9 +90,9 @@ jobs:
# quickinspectortest|quickinspectortest2 fails at CI, local with 6.2.4 passes
# modelinspectortest fails in Qt6/CI passes locally
- name: Run tests on Linux Qt6 (offscreen)
if: ${{ runner.os == 'Linux' && matrix.config.qt_major == 6 }}
if: ${{ runner.os == 'Linux' && startsWith(matrix.config.qt_version, '6.') }}
run: >
ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
ctest --test-dir ./build-${{ matrix.config.preset }} -C 'Debug' --output-on-failure
--exclude-regex "quickmaterialtest|quicktexturetest|bindinginspectortest|quickinspectortest|quickinspectortest2|modelinspectortest|timertoptest"
env:
QT_QPA_PLATFORM: offscreen
Expand All @@ -107,9 +103,9 @@ jobs:
#26 - launchertest (Failed)
#37 - quickinspectortest2 (Failed)
- name: Run tests Qt5 on macOS
if: ${{ runner.os == 'macOS' && matrix.config.qt_major == 5 }}
if: ${{ runner.os == 'macOS' && startsWith(matrix.config.qt_version, '5.') }}
run: >
ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
ctest --test-dir ./build-${{ matrix.config.preset }} -C 'Debug' --output-on-failure
--exclude-regex "probeabidetectortest|launchertest|quickinspectortest2|timertoptest"
# Exclude
Expand All @@ -120,33 +116,33 @@ jobs:
# quickinspectortest2
# bindinginspectortest fails in client_and_ui
- name: Run tests Qt6 on macOS
if: ${{ runner.os == 'macOS' && matrix.config.qt_major == 6 }}
if: ${{ runner.os == 'macOS' && startsWith(matrix.config.qt_version, '6.') }}
run: >
ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
ctest --test-dir ./build-${{ matrix.config.preset }} -C 'Debug' --output-on-failure
--exclude-regex
"probeabidetectortest|launchertest|clientconnectiontest|modelinspectortest|quickinspectortest2|bindinginspectortest|quicktexturetest|timertoptest"
# Exclude
# quicktexturetest
# bindinginspectortest
- name: Qt5 Run tests on Windows
if: ${{ runner.os == 'Windows' && matrix.config.qt_major == 5 }}
if: ${{ runner.os == 'Windows' && startsWith(matrix.config.qt_version, '5.') }}
run: >
ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
ctest --test-dir ./build-${{ matrix.config.preset }} -C 'Debug' --output-on-failure
--exclude-regex "quicktexturetest|bindinginspectortest|timertoptest"
# Exclude
# quicktexturetest
# bindinginspectortest
# modelinspectortest fails in Qt6/CI passes locally
- name: Qt6 Run tests on Windows
if: ${{ runner.os == 'Windows' && matrix.config.qt_major == 6 }}
if: ${{ runner.os == 'Windows' && startsWith(matrix.config.qt_version, '6.') }}
run: >
ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
ctest --test-dir ./build-${{ matrix.config.preset }} -C 'Debug' --output-on-failure
--exclude-regex "quicktexturetest|launchertest|bindinginspectortest|modelinspectortest|timertoptest|probesettingstest"
- name: Read tests log when it fails
uses: andstor/file-reader-action@v1
if: ${{ failure() }}
with:
path: "./build/Testing/Temporary/LastTest.log"
path: "./build-${{ matrix.config.preset }}/Testing/Temporary/LastTest.log"
24 changes: 11 additions & 13 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
schedule:
- cron: '0 3 * * *'

push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -18,13 +25,11 @@ jobs:
- ubuntu-latest

config:
- name: clang-tidy
cmake_arg: '-DCMAKE_CXX_CLANG_TIDY=clang-tidy'
- preset: ci-dev-clang-tidy-qt6
qt_version: "6.6"
qt_modules: qtshadertools qtscxml

- name: clazy
cmake_arg: '-DCMAKE_CXX_COMPILER=clazy'
- preset: ci-dev-clazy-qt6
qt_version: "6.6"
qt_modules: qtshadertools qtscxml
apt_pgks:
Expand Down Expand Up @@ -54,14 +59,7 @@ jobs:

- name: Configure project
run: >
cmake -S . -B ./build -G Ninja ${{ matrix.config.cmake_arg }}
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-Werror=dev
-DECM_ENABLE_SANITIZERS=address
-DGAMMARAY_QT6_BUILD=ON
-DGAMMARAY_DISABLE_FEEDBACK=ON
-DGAMMARAY_BUILD_DOCS=${{ matrix.config.name == 'clazy' }}
-DGAMMARAY_MULTI_BUILD=${{ matrix.config.name == 'clazy' }}
cmake -S . -G Ninja --preset ${{ matrix.config.preset }}
- name: Build Project
run: cmake --build ./build
run: cmake --build ./build-${{ matrix.config.preset }}
129 changes: 115 additions & 14 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
{
"version": 2,
"configurePresets": [
{
"name": "base",
"generator": "Ninja",
"hidden": true,
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"warnings": {
"uninitialized": true
}
},
{
"name": "dev",
"displayName": "dev",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev",
"cacheVariables": {
"QT_VERSION_MAJOR": "5",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"GAMMARAY_USE_PCH": "ON"
}
},
"inherits": [
"base"
]
},
{
"name": "dev6",
"displayName": "dev qt6",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-dev-qt6",
"cacheVariables": {
"QT_VERSION_MAJOR": "6",
"GAMMARAY_USE_PCH": "ON",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
"GAMMARAY_USE_PCH": "ON"
},
"inherits": [
"base"
]
},
{
"name": "dev-asan",
Expand Down Expand Up @@ -127,6 +140,100 @@
"CXX": "clazy",
"CCACHE_DISABLE": "ON"
}
},
{
"name": "ci-dev-client-only-qt5",
"displayName": "ci-dev-client-only-qt5",
"description": "Qt5 client-only build",
"binaryDir": "${sourceDir}/build-ci-dev-client-only-qt5",
"generator": "Ninja",
"cacheVariables": {
"GAMMARAY_CLIENT_ONLY_BUILD": "ON",
"GAMMARAY_INSTALL_QT_LAYOUT": "ON",
"GAMMARAY_MULTI_BUILD": "OFF"
},
"inherits": [
"dev"
]
},
{
"name": "ci-dev-client-only-qt6",
"displayName": "ci-dev-client-only-qt6",
"description": "Qt6 client-only build",
"binaryDir": "${sourceDir}/build-ci-dev-client-only-qt6",
"generator": "Ninja",
"cacheVariables": {
"GAMMARAY_CLIENT_ONLY_BUILD": "ON",
"GAMMARAY_INSTALL_QT_LAYOUT": "ON",
"GAMMARAY_MULTI_BUILD": "OFF"
},
"inherits": [
"dev6"
]
},
{
"name": "ci-dev-client-and-ui-qt5",
"displayName": "ci-dev-client-and-ui-qt5",
"description": "Qt5 client and ui build",
"binaryDir": "${sourceDir}/build-ci-dev-client-and-ui-qt5",
"generator": "Ninja",
"cacheVariables": {
"GAMMARAY_CLIENT_ONLY_BUILD": "OFF",
"GAMMARAY_INSTALL_QT_LAYOUT": "ON",
"GAMMARAY_MULTI_BUILD": "OFF"
},
"inherits": [
"dev"
]
},
{
"name": "ci-dev-client-and-ui-qt6",
"displayName": "ci-dev-client-and-ui-qt6",
"description": "Qt6 client and ui build",
"binaryDir": "${sourceDir}/build-ci-dev-client-and-ui-qt6",
"generator": "Ninja",
"cacheVariables": {
"GAMMARAY_CLIENT_ONLY_BUILD": "OFF",
"GAMMARAY_INSTALL_QT_LAYOUT": "ON",
"GAMMARAY_MULTI_BUILD": "OFF"
},
"inherits": [
"dev6"
]
},
{
"name": "ci-dev-clang-tidy-qt6",
"displayName": "ci-dev-clang-tidy-qt6",
"description": "Qt6 clang-tidy build",
"binaryDir": "${sourceDir}/build-ci-dev-clang-tidy-qt6",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_CXX_CLANG_TIDY": "clang-tidy",
"ECM_ENABLE_SANITIZERS": "address",
"GAMMARAY_BUILD_DOCS": "OFF",
"GAMMARAY_MULTI_BUILD": "OFF",
"GAMMARAY_DISABLE_FEEDBACK": "ON"
},
"inherits": [
"dev6"
]
},
{
"name": "ci-dev-clazy-qt6",
"displayName": "ci-dev-clazy-qt6",
"description": "Qt6 clazy build",
"binaryDir": "${sourceDir}/build-ci-dev-clazy-qt6",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "clazy",
"ECM_ENABLE_SANITIZERS": "address",
"GAMMARAY_BUILD_DOCS": "ON",
"GAMMARAY_MULTI_BUILD": "ON",
"GAMMARAY_DISABLE_FEEDBACK": "ON"
},
"inherits": [
"dev6"
]
}
],
"buildPresets": [
Expand All @@ -135,20 +242,14 @@
"configurePreset": "dev",
"targets": [
"all"
],
"cacheVariables": {
"QT_VERSION_MAJOR": "5"
}
]
},
{
"name": "clazy",
"configurePreset": "clazy",
"environment": {
"CLAZY_CHECKS": "level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo",
"CCACHE_DISABLE": "ON"
},
"cacheVariables": {
"QT_VERSION_MAJOR": "5"
}
}
]
Expand Down

0 comments on commit f1a6274

Please sign in to comment.