Skip to content

Commit 7ce6588

Browse files
committed
ci: add GitHub Actions CI workflows for Arch Linux and Deepin builds
Add CI workflows to verify the project builds correctly on both Arch Linux (latest) and Deepin crimson. This helps catch any platform-specific compilation issues introduced by the accessor pattern refactor.
1 parent 0802dd7 commit 7ce6588

2 files changed

Lines changed: 290 additions & 0 deletions

File tree

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Build dtkdeclarative on Arch Linux
2+
3+
on:
4+
push:
5+
6+
pull_request:
7+
8+
jobs:
9+
container:
10+
runs-on: ubuntu-latest
11+
container: archlinux:latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- qt_version: 5
17+
dtk5: "ON"
18+
- qt_version: 6
19+
dtk5: "OFF"
20+
steps:
21+
- name: Initialize pacman and system update
22+
run: |
23+
pacman-key --init
24+
pacman --noconfirm --noprogressbar -Syu
25+
26+
- name: Install base build tools
27+
run: |
28+
pacman -S --noconfirm --noprogressbar base-devel git cmake ninja pkgconf
29+
30+
- name: Install dtkdeclarative Qt5 system dependencies
31+
if: matrix.qt_version == 5
32+
run: |
33+
pacman -S --noconfirm --noprogressbar \
34+
qt5-base qt5-tools qt5-declarative qt5-quickcontrols2 \
35+
qt5-wayland qt5-svg qt5-imageformats \
36+
extra-cmake-modules \
37+
gtest \
38+
librsvg libraw \
39+
libqt5xdg \
40+
icu uchardet dbus spdlog gsettings-qt \
41+
dtkcommon dtklog \
42+
treeland-protocols dtkcore dtkgui
43+
44+
- name: Install dtkdeclarative Qt6 system dependencies
45+
if: matrix.qt_version == 6
46+
run: |
47+
pacman -S --noconfirm --noprogressbar \
48+
qt6-base qt6-tools qt6-declarative qt6-shadertools \
49+
qt6-wayland qt6-svg qt6-imageformats \
50+
extra-cmake-modules \
51+
gtest \
52+
librsvg libraw \
53+
libqtxdg \
54+
icu uchardet dbus spdlog gsettings-qt \
55+
vulkan-headers \
56+
dtkcommon dtk6log \
57+
treeland-protocols dtk6core dtk6gui
58+
59+
- uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
63+
- name: Build and install latest DTK dependencies from source
64+
run: |
65+
set -euxo pipefail
66+
67+
build_repo() {
68+
local repo="$1"
69+
local extra_args="${2:-}"
70+
case "${repo}" in
71+
dtkcommon|dtklog|dtkcore|dtkgui) ;;
72+
*) echo "unsupported repo: ${repo}" >&2; exit 1 ;;
73+
esac
74+
cd /tmp
75+
rm -rf "${repo}"
76+
git clone --depth=1 "https://github.com/linuxdeepin/${repo}.git"
77+
cmake -S "${repo}" -B "${repo}/build" \
78+
-GNinja \
79+
-DCMAKE_BUILD_TYPE=Release \
80+
-DCMAKE_INSTALL_PREFIX=/usr \
81+
${extra_args}
82+
cmake --build "${repo}/build" -j"$(nproc)"
83+
cmake --install "${repo}/build"
84+
}
85+
86+
build_repo dtkcommon
87+
build_repo dtklog "-DDTK5=${{ matrix.dtk5 }}"
88+
build_repo dtkcore "-DDTK5=${{ matrix.dtk5 }}"
89+
build_repo dtkgui "-DDTK5=${{ matrix.dtk5 }}"
90+
91+
- name: Configure dtkdeclarative
92+
run: |
93+
set -o pipefail
94+
cmake -B build \
95+
-GNinja \
96+
-DCMAKE_INSTALL_PREFIX=/usr \
97+
-DCMAKE_INSTALL_LIBDIR=lib \
98+
-DCMAKE_BUILD_TYPE=Release \
99+
-DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules \
100+
-DQML_INSTALL_DIR=lib/qt/qml \
101+
-DBUILD_DOCS=OFF \
102+
-DBUILD_EXAMPLES=OFF \
103+
-DBUILD_TESTING=ON \
104+
-DDTK5=${{ matrix.dtk5 }} 2>&1 | tee /tmp/cmake-configure.log
105+
echo "✅ Configure done"
106+
107+
- name: Print configure log on failure
108+
if: failure()
109+
run: |
110+
echo "=== cmake-configure.log (last 80 lines) ==="
111+
tail -80 /tmp/cmake-configure.log 2>/dev/null || echo "(not found)"
112+
tail -20 /tmp/cmake-configure.log 2>/dev/null | while IFS= read -r line; do
113+
echo "::error::$line"
114+
done
115+
116+
- name: Build dtkdeclarative
117+
run: |
118+
set -o pipefail
119+
cmake --build build -j$(nproc) 2>&1 | tee /tmp/cmake-build.log
120+
echo "✅ dtkdeclarative Qt${{ matrix.qt_version }} built successfully!"
121+
echo "=== Built files ==="
122+
find build -name "*.so" -o -name "*.a" | head -20
123+
124+
- name: Print build log on failure
125+
if: failure()
126+
run: |
127+
echo "=== cmake-build.log (last 100 lines) ==="
128+
tail -100 /tmp/cmake-build.log 2>/dev/null || echo "(not found)"
129+
grep -E "error:|Error:|FAILED" /tmp/cmake-build.log 2>/dev/null | head -20 | while IFS= read -r line; do
130+
echo "::error::$line"
131+
done
132+
133+
- name: Run unit tests
134+
run: |
135+
set -o pipefail
136+
QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure --timeout 300 -j$(nproc) 2>&1 | tee /tmp/ctest.log
137+
echo "✅ dtkdeclarative Qt${{ matrix.qt_version }} tests passed!"
138+
139+
- name: Print test log on failure
140+
if: failure()
141+
run: |
142+
echo "=== ctest.log (last 100 lines) ==="
143+
tail -100 /tmp/ctest.log 2>/dev/null || echo "(not found)"
144+
grep -E "FAILED|Error:|The following tests FAILED" /tmp/ctest.log 2>/dev/null | head -20 | while IFS= read -r line; do
145+
echo "::error::$line"
146+
done
147+
148+
- name: Install dtkdeclarative to staging directory
149+
run: |
150+
DESTDIR=/tmp/dtkdeclarative-install cmake --install build
151+
echo "Total: $(find /tmp/dtkdeclarative-install -type f | wc -l) files"
152+
find /tmp/dtkdeclarative-install -type f | head -20
153+
154+
- name: Print install log on failure
155+
if: failure()
156+
run: echo "::error::Install step failed — check the step output above"
157+
158+
- name: Create installation package
159+
run: |
160+
ls -la /tmp/dtkdeclarative-install/ || { echo "Install dir missing!"; exit 1; }
161+
tar -czf /tmp/dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-$(date +%Y%m%d-%H%M%S).tar.gz -C /tmp/dtkdeclarative-install .
162+
ls -la /tmp/dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-*.tar.gz
163+
164+
- name: Upload dtkdeclarative Arch Linux build artifacts
165+
if: ${{ !env.ACT }}
166+
uses: actions/upload-artifact@v4
167+
with:
168+
name: dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-build
169+
path: "/tmp/dtkdeclarative-archlinux-qt${{ matrix.qt_version }}-*.tar.gz"
170+
if-no-files-found: error
171+
retention-days: 30
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Build dtkdeclarative on Deepin crimson
2+
3+
on:
4+
push:
5+
6+
pull_request:
7+
8+
jobs:
9+
container:
10+
runs-on: ubuntu-latest
11+
container: linuxdeepin/deepin:crimson
12+
strategy:
13+
matrix:
14+
include:
15+
- qt_version: 5
16+
dtk_profile: nodtk6
17+
- qt_version: 6
18+
dtk_profile: nodtk5
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup apt sources and build tools
23+
run: |
24+
set -euxo pipefail
25+
echo "deb [trusted=yes] http://mirrors.kernel.org/deepin/beige/ crimson main commercial community" > /etc/apt/sources.list
26+
echo "deb-src [trusted=yes] http://mirrors.kernel.org/deepin/beige/ crimson main commercial community" >> /etc/apt/sources.list
27+
rm -rf /etc/apt/sources.list.d
28+
apt-get update
29+
apt-get install -y devscripts equivs git
30+
31+
- name: Build and install dtkcommon from source
32+
run: |
33+
set -euxo pipefail
34+
cd /tmp
35+
git clone --depth=1 https://github.com/linuxdeepin/dtkcommon.git
36+
cd dtkcommon
37+
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
38+
dpkg-buildpackage -uc -us -b
39+
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
40+
echo "✅ dtkcommon installed"
41+
42+
- name: Build and install dtklog from source
43+
run: |
44+
set -euxo pipefail
45+
cd /tmp
46+
git clone --depth=1 https://github.com/linuxdeepin/dtklog.git
47+
cd dtklog
48+
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
49+
dpkg-buildpackage -uc -us -b -P${{ matrix.dtk_profile }}
50+
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
51+
echo "✅ dtklog installed"
52+
53+
- name: Build and install treeland-protocols from source
54+
run: |
55+
set -euxo pipefail
56+
apt-get install -y --allow-unauthenticated wlr-protocols || true
57+
cd /tmp
58+
git clone --depth=1 https://github.com/linuxdeepin/treeland-protocols.git
59+
cd treeland-protocols
60+
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
61+
dpkg-buildpackage -uc -us -b
62+
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
63+
echo "✅ treeland-protocols installed"
64+
65+
- name: Build and install dtkcore from source
66+
run: |
67+
set -euxo pipefail
68+
cd /tmp
69+
git clone --depth=1 https://github.com/linuxdeepin/dtkcore.git
70+
cd dtkcore
71+
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
72+
dpkg-buildpackage -uc -us -b -P${{ matrix.dtk_profile }}
73+
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
74+
echo "✅ dtkcore installed"
75+
76+
- name: Build and install dtkgui from source
77+
run: |
78+
set -euxo pipefail
79+
cd /tmp
80+
git clone --depth=1 https://github.com/linuxdeepin/dtkgui.git
81+
cd dtkgui
82+
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
83+
dpkg-buildpackage -uc -us -b -P${{ matrix.dtk_profile }}
84+
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
85+
echo "✅ dtkgui installed"
86+
87+
- name: Install dtkdeclarative build dependencies
88+
run: |
89+
set -euxo pipefail
90+
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
91+
92+
- name: Enable unit tests in deb build
93+
run: |
94+
set -euxo pipefail
95+
if grep -q 'BUILD_TESTING=OFF' debian/rules; then
96+
sed -i 's/BUILD_TESTING=OFF/BUILD_TESTING=ON/g' debian/rules
97+
fi
98+
99+
- name: Build dtkdeclarative deb packages
100+
run: |
101+
set -euxo pipefail
102+
export QT_QPA_PLATFORM=offscreen
103+
dpkg-buildpackage -uc -us -b -P${{ matrix.dtk_profile }}
104+
echo "✅ dtkdeclarative Qt${{ matrix.qt_version }} deb packages built successfully!"
105+
ls -la ../
106+
107+
- name: Collect deb artifacts
108+
run: |
109+
mkdir -p dist
110+
mv ../*.deb dist/
111+
ls -la dist
112+
113+
- name: Upload dtkdeclarative deb packages as artifacts
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: dtkdeclarative-deepin-deb-packages-qt${{ matrix.qt_version }}
117+
path: dist/*.deb
118+
if-no-files-found: error
119+
retention-days: 30

0 commit comments

Comments
 (0)