Skip to content

Commit 8dcdca8

Browse files
committed
ci: split Qt5 and Qt6 workflow steps
1 parent 28f892a commit 8dcdca8

2 files changed

Lines changed: 49 additions & 16 deletions

File tree

.github/workflows/dtkdeclarative-archlinux-build.yml

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,46 @@ jobs:
6060
with:
6161
fetch-depth: 0
6262

63-
- name: Build and install latest DTK dependencies from source
63+
- name: Build and install latest DTK Qt5 dependencies from source
64+
if: matrix.qt_version == 5
65+
run: |
66+
set -euxo pipefail
67+
68+
build_repo() {
69+
local repo="$1"
70+
shift
71+
case "${repo}" in
72+
dtkcommon|dtklog|dtkcore|dtkgui) ;;
73+
*) echo "unsupported repo: ${repo}" >&2; exit 1 ;;
74+
esac
75+
cd /tmp
76+
rm -rf "${repo}"
77+
git clone --depth=1 "https://github.com/linuxdeepin/${repo}.git"
78+
cmake -S "${repo}" -B "${repo}/build" \
79+
-GNinja \
80+
-DCMAKE_BUILD_TYPE=Release \
81+
-DCMAKE_INSTALL_PREFIX=/usr \
82+
-DBUILD_DOCS=OFF \
83+
-DBUILD_EXAMPLES=OFF \
84+
-DBUILD_TESTING=OFF \
85+
"$@"
86+
cmake --build "${repo}/build" -j"$(nproc)"
87+
cmake --install "${repo}/build"
88+
}
89+
90+
build_repo dtkcommon
91+
build_repo dtklog -DDTK5=ON
92+
build_repo dtkcore -DDTK5=ON
93+
build_repo dtkgui -DDTK5=ON
94+
95+
- name: Build and install latest DTK Qt6 dependencies from source
96+
if: matrix.qt_version == 6
6497
run: |
6598
set -euxo pipefail
6699
67100
build_repo() {
68101
local repo="$1"
69-
local extra_args="${2:-}"
102+
shift
70103
case "${repo}" in
71104
dtkcommon|dtklog|dtkcore|dtkgui) ;;
72105
*) echo "unsupported repo: ${repo}" >&2; exit 1 ;;
@@ -81,17 +114,17 @@ jobs:
81114
-DBUILD_DOCS=OFF \
82115
-DBUILD_EXAMPLES=OFF \
83116
-DBUILD_TESTING=OFF \
84-
${extra_args}
117+
"$@"
85118
cmake --build "${repo}/build" -j"$(nproc)"
86119
cmake --install "${repo}/build"
87120
}
88121
89122
build_repo dtkcommon
90-
build_repo dtklog "-DDTK5=${{ matrix.dtk5 }}"
91-
build_repo dtkcore "-DDTK5=${{ matrix.dtk5 }}"
92-
build_repo dtkgui "-DDTK5=${{ matrix.dtk5 }}"
123+
build_repo dtklog -DDTK5=OFF
124+
build_repo dtkcore -DDTK5=OFF
125+
build_repo dtkgui -DDTK5=OFF
93126
94-
- name: Configure dtkdeclarative
127+
- name: Configure dtkdeclarative for Qt${{ matrix.qt_version }}
95128
run: |
96129
set -o pipefail
97130
cmake -B build \
@@ -116,7 +149,7 @@ jobs:
116149
echo "::error::$line"
117150
done
118151
119-
- name: Build dtkdeclarative
152+
- name: Build dtkdeclarative for Qt${{ matrix.qt_version }}
120153
run: |
121154
set -o pipefail
122155
cmake --build build -j$(nproc) 2>&1 | tee /tmp/cmake-build.log
@@ -149,7 +182,7 @@ jobs:
149182
echo "::error::$line"
150183
done
151184
152-
- name: Install dtkdeclarative to staging directory
185+
- name: Install dtkdeclarative Qt${{ matrix.qt_version }} to staging directory
153186
run: |
154187
DESTDIR=/tmp/dtkdeclarative-install cmake --install build
155188
echo "Total: $(find /tmp/dtkdeclarative-install -type f | wc -l) files"

.github/workflows/dtkdeclarative-deepin-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
4040
echo "✅ dtkcommon installed"
4141
42-
- name: Build and install dtklog from source
42+
- name: Build and install dtklog from source for Qt${{ matrix.qt_version }}
4343
run: |
4444
set -euxo pipefail
4545
cd /tmp
@@ -50,7 +50,7 @@ jobs:
5050
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
5151
echo "✅ dtklog installed"
5252
53-
- name: Build and install treeland-protocols from source
53+
- name: Build and install treeland-protocols from source for Qt${{ matrix.qt_version }}
5454
run: |
5555
set -euxo pipefail
5656
apt-get install -y --allow-unauthenticated wlr-protocols || true
@@ -62,7 +62,7 @@ jobs:
6262
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
6363
echo "✅ treeland-protocols installed"
6464
65-
- name: Build and install dtkcore from source
65+
- name: Build and install dtkcore from source for Qt${{ matrix.qt_version }}
6666
run: |
6767
set -euxo pipefail
6868
cd /tmp
@@ -73,7 +73,7 @@ jobs:
7373
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
7474
echo "✅ dtkcore installed"
7575
76-
- name: Build and install dtkgui from source
76+
- name: Build and install dtkgui from source for Qt${{ matrix.qt_version }}
7777
run: |
7878
set -euxo pipefail
7979
cd /tmp
@@ -84,20 +84,20 @@ jobs:
8484
dpkg -i ../*.deb 2>/dev/null || apt-get install -f -y
8585
echo "✅ dtkgui installed"
8686
87-
- name: Install dtkdeclarative build dependencies
87+
- name: Install dtkdeclarative Qt${{ matrix.qt_version }} build dependencies
8888
run: |
8989
set -euxo pipefail
9090
mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
9191
92-
- name: Enable unit tests in deb build
92+
- name: Enable unit tests in Qt${{ matrix.qt_version }} deb build
9393
if: matrix.dtk_profile == 'nodtk6'
9494
run: |
9595
set -euxo pipefail
9696
if grep -q 'BUILD_TESTING=OFF' debian/rules; then
9797
sed -i 's/BUILD_TESTING=OFF/BUILD_TESTING=ON/g' debian/rules
9898
fi
9999
100-
- name: Build dtkdeclarative deb packages
100+
- name: Build dtkdeclarative Qt${{ matrix.qt_version }} deb packages
101101
run: |
102102
set -euxo pipefail
103103
export QT_QPA_PLATFORM=offscreen

0 commit comments

Comments
 (0)