-
Notifications
You must be signed in to change notification settings - Fork 15
89 lines (75 loc) · 2.53 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: MIT
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
preset:
- cpp14
- cpp17
- cpp20
- cpp23
qt:
- version: "5.15.2"
requested: "5.15"
- version: "6.3.2" # Qt 6.3 is not an LTS version, so '6.3.*' always resolves to '6.3.2'
requested: "6.3.*"
steps:
- name: Install Qt with options and default aqtversion
uses: jurplel/install-qt-action@v3
with:
aqtversion: null # use whatever the default is
modules: ${{ matrix.qt.modules }}
version: ${{ matrix.qt.requested }}
cache: true
- name: Checkout sources
uses: actions/checkout@v4
- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main
- name: Make sure MSVC is found when Ninja generator is in use
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Configure Debug Build
run: >
cmake -S . -B ./build-debug --preset ${{ matrix.preset }}
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_TESTING=ON
-DKDALGORITHMS_BUILD_TEST=ON
- name: Build Project (Debug)
run: cmake --build ./build-debug
- name: Run Debug tests
run: ctest --test-dir ./build-debug -C Debug --output-on-failure
# KDAlgorithms CI only matters (and builds) for the tests and since
# the only value of a Release build is that maybe the compiler
# does some optimization that breaks them we do both builds
# in the same worker.
- name: Configure Release Build
run: >
cmake -S . -B ./build-release --preset ${{ matrix.preset }}
-DCMAKE_BUILD_TYPE=Release
-DBUILD_TESTING=ON
-DKDALGORITHMS_BUILD_TEST=ON
- name: Build Project (Release)
run: cmake --build ./build-release
- name: Run Release tests
run: ctest --test-dir ./build-release -C Release --output-on-failure
- name: Read tests log when it fails
uses: andstor/file-reader-action@v1
if: ${{ failure() }}
with:
path: "./build/Testing/Temporary/LastTest.log"