-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathdtkdeclarative-archlinux-build.yml
More file actions
208 lines (185 loc) · 7.3 KB
/
dtkdeclarative-archlinux-build.yml
File metadata and controls
208 lines (185 loc) · 7.3 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Build dtkdeclarative on Arch Linux
on:
push:
pull_request:
jobs:
container:
runs-on: ubuntu-latest
container: archlinux:latest
strategy:
fail-fast: false
matrix:
include:
- qt_version: 5
dtk5: "ON"
- qt_version: 6
dtk5: "OFF"
steps:
- name: Initialize pacman and system update
run: |
pacman-key --init
pacman --noconfirm --noprogressbar -Syu
- name: Install base build tools
run: |
pacman -S --noconfirm --noprogressbar base-devel git cmake ninja pkgconf
- name: Install dtkdeclarative Qt5 system dependencies
if: matrix.qt_version == 5
run: |
pacman -S --noconfirm --noprogressbar \
qt5-base qt5-tools qt5-declarative qt5-quickcontrols2 \
qt5-wayland qt5-svg qt5-imageformats \
extra-cmake-modules \
gtest \
librsvg libraw \
libqt5xdg \
icu uchardet dbus spdlog gsettings-qt \
dtkcommon dtklog \
treeland-protocols dtkcore dtkgui
- name: Install dtkdeclarative Qt6 system dependencies
if: matrix.qt_version == 6
run: |
pacman -S --noconfirm --noprogressbar \
qt6-base qt6-tools qt6-declarative qt6-shadertools \
qt6-wayland qt6-svg qt6-imageformats \
extra-cmake-modules \
gtest \
librsvg libraw \
libqtxdg \
icu uchardet dbus spdlog gsettings-qt \
vulkan-headers \
dtkcommon dtk6log \
treeland-protocols dtk6core dtk6gui
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build and install latest DTK Qt5 dependencies from source
if: matrix.qt_version == 5
run: |
set -euxo pipefail
build_repo() {
local repo="$1"
shift
case "${repo}" in
dtkcommon|dtklog|dtkcore|dtkgui) ;;
*) echo "unsupported repo: ${repo}" >&2; exit 1 ;;
esac
cd /tmp
rm -rf "${repo}"
git clone --depth=1 "https://github.com/linuxdeepin/${repo}.git"
cmake -S "${repo}" -B "${repo}/build" \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
"$@"
cmake --build "${repo}/build" -j"$(nproc)"
cmake --install "${repo}/build"
}
build_repo dtkcommon
build_repo dtklog -DDTK5=ON
build_repo dtkcore -DDTK5=ON
build_repo dtkgui -DDTK5=ON
- name: Build and install latest DTK Qt6 dependencies from source
if: matrix.qt_version == 6
run: |
set -euxo pipefail
build_repo() {
local repo="$1"
shift
case "${repo}" in
dtkcommon|dtklog|dtkcore|dtkgui) ;;
*) echo "unsupported repo: ${repo}" >&2; exit 1 ;;
esac
cd /tmp
rm -rf "${repo}"
git clone --depth=1 "https://github.com/linuxdeepin/${repo}.git"
cmake -S "${repo}" -B "${repo}/build" \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
"$@"
cmake --build "${repo}/build" -j"$(nproc)"
cmake --install "${repo}/build"
}
build_repo dtkcommon
build_repo dtklog -DDTK5=OFF
build_repo dtkcore -DDTK5=OFF
build_repo dtkgui -DDTK5=OFF
- name: Configure dtkdeclarative for Qt${{ matrix.qt_version }}
run: |
set -o pipefail
cmake -B build \
-GNinja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release \
-DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules \
-DQML_INSTALL_DIR=lib/qt/qml \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=${{ matrix.dtk5 }} \
-DDTK5=${{ matrix.dtk5 }} 2>&1 | tee /tmp/cmake-configure.log
echo "✅ Configure done"
- name: Print configure log on failure
if: failure()
run: |
echo "=== cmake-configure.log (last 80 lines) ==="
tail -80 /tmp/cmake-configure.log 2>/dev/null || echo "(not found)"
tail -20 /tmp/cmake-configure.log 2>/dev/null | while IFS= read -r line; do
echo "::error::$line"
done
- name: Build dtkdeclarative for Qt${{ matrix.qt_version }}
run: |
set -o pipefail
cmake --build build -j$(nproc) 2>&1 | tee /tmp/cmake-build.log
echo "✅ dtkdeclarative Qt${{ matrix.qt_version }} built successfully!"
echo "=== Built files ==="
find build -name "*.so" -o -name "*.a" | head -20
- name: Print build log on failure
if: failure()
run: |
echo "=== cmake-build.log (last 100 lines) ==="
tail -100 /tmp/cmake-build.log 2>/dev/null || echo "(not found)"
grep -E "error:|Error:|FAILED" /tmp/cmake-build.log 2>/dev/null | head -20 | while IFS= read -r line; do
echo "::error::$line"
done
- name: Run unit tests
if: matrix.dtk5 == 'ON'
run: |
set -o pipefail
QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure --timeout 300 -j$(nproc) 2>&1 | tee /tmp/ctest.log
echo "✅ dtkdeclarative Qt${{ matrix.qt_version }} tests passed!"
- name: Print test log on failure
if: failure() && matrix.dtk5 == 'ON'
run: |
echo "=== ctest.log (last 100 lines) ==="
tail -100 /tmp/ctest.log 2>/dev/null || echo "(not found)"
grep -E "FAILED|Error:|The following tests FAILED" /tmp/ctest.log 2>/dev/null | head -20 | while IFS= read -r line; do
echo "::error::$line"
done
- name: Install dtkdeclarative Qt${{ matrix.qt_version }} to staging directory
run: |
DESTDIR=/tmp/dtkdeclarative-install cmake --install build
echo "Total: $(find /tmp/dtkdeclarative-install -type f | wc -l) files"
find /tmp/dtkdeclarative-install -type f | head -20
- name: Print install log on failure
if: failure()
run: echo "::error::Install step failed — check the step output above"
- name: Create installation package
run: |
ls -la /tmp/dtkdeclarative-install/ || { echo "Install dir missing!"; exit 1; }
tar -czf /tmp/dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-$(date +%Y%m%d-%H%M%S).tar.gz -C /tmp/dtkdeclarative-install .
ls -la /tmp/dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-*.tar.gz
- name: Upload dtkdeclarative Arch Linux build artifacts
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-build
path: "/tmp/dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-*.tar.gz"
if-no-files-found: error
retention-days: 30