-
Notifications
You must be signed in to change notification settings - Fork 3
129 lines (112 loc) · 3.71 KB
/
build.yml
File metadata and controls
129 lines (112 loc) · 3.71 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build QLiteHtmlBrowser
on:
push:
branches: [main, qt6, qt5]
pull_request:
workflow_call:
jobs:
check-formatting:
name: Check code formatting
runs-on: ubuntu-latest
strategy:
matrix:
path: ['include', 'src', 'test']
steps:
- uses: actions/checkout@v4
- uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '18'
check-path: ${{ matrix.path }}
build:
needs: check-formatting
name: Build (${{ matrix.os }} - Qt ${{ matrix.qt-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# ========== Linux Builds ==========
# Qt 6 (latest) on Linux
- os: ubuntu-latest
qt-version: '6.7.*'
qt-modules: 'qt5compat'
name: Linux-Qt6
use-apt: false
test-cmd: xvfb-run -a ctest -V -E NOT_BUILT
# Qt 5.15 LTS on Linux
- os: ubuntu-22.04
qt-version: '5.15.2'
qt-modules: ''
name: Linux-Qt5
use-apt: true
apt-packages: 'qtbase5-dev qttools5-dev ninja-build xvfb libxcb-cursor0'
test-cmd: xvfb-run -a ctest -V -E NOT_BUILT
# ========== Windows Builds ==========
# Qt 6 (latest) on Windows
- os: windows-latest
qt-version: '6.7.*'
qt-arch: 'win64_msvc2019_64'
qt-modules: 'qt5compat'
name: Windows-Qt6
use-apt: false
test-cmd: ctest -C Release -V -E NOT_BUILT
# Qt 5.15 LTS on Windows
- os: windows-latest
qt-version: '5.15.2'
qt-arch: 'win64_msvc2019_64'
qt-modules: ''
name: Windows-Qt5
use-apt: false
test-cmd: ctest -C Release -V -E NOT_BUILT
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# ========== Linux: Qt via APT (Qt5 only) ==========
- name: Install Qt via APT (Linux Qt5)
if: runner.os == 'Linux' && matrix.use-apt
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.apt-packages }}
# ========== Linux/Windows: Qt via installer (Qt6 and Windows Qt5) ==========
- name: Install Qt via installer
if: ${{ !matrix.use-apt }}
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
arch: ${{ matrix.qt-arch || '' }}
modules: ${{ matrix.qt-modules }}
cache: true
# ========== Windows: MSVC + Ninja ==========
- name: Setup MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Install Ninja (Linux - if needed)
if: runner.os == 'Linux' && !matrix.use-apt
run: sudo apt-get install -y ninja-build xvfb libxcb-cursor0
# ========== CMake Configure ==========
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: |
cmake -B build `
-GNinja `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_C_COMPILER=cl `
-DCMAKE_CXX_COMPILER=cl
# ========== Build ==========
- name: Build
run: cmake --build build --config Release
# ========== Test ==========
- name: Run Tests
working-directory: build
run: ${{ matrix.test-cmd }}
continue-on-error: true