mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-13 03:51:10 +00:00
ci(plasma): fail only on core breakage, note optional plugins
This commit is contained in:
1 file changed
+18
-6
@@ -8,6 +8,7 @@
|
||||
set -euo pipefail
|
||||
# On Actions, failures also go out as annotations, which can be read back without the log.
|
||||
annotate() { [ -n "${GITHUB_ACTIONS:-}" ] && echo "::error title=plasma smoke test::$*"; echo "$*"; }
|
||||
notice() { [ -n "${GITHUB_ACTIONS:-}" ] && echo "::notice title=plasma smoke test::$*"; echo "$*"; }
|
||||
trap 'annotate "stopped at line $LINENO: $BASH_COMMAND"' ERR
|
||||
pkg=$(realpath "${1:?plasma.tar.zst}")
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
@@ -42,20 +43,31 @@ while read -r f; do
|
||||
head -c 4 "$root/$f" | grep -q $'\x7fELF' || continue
|
||||
sudo chroot "$root" /usr/bin/ldd "/$f" 2>&1 | grep -E "not found" | sed "s#^#/$f: #" >> "$work/unresolved.txt" || true
|
||||
done < "$work/files.txt"
|
||||
# What the desktop runs must resolve completely. Plugins that need an optional dependency the
|
||||
# package does not bring (Python bindings, PackageKit, SQL drivers...) only fail to load, as they
|
||||
# do on any Arch install without those extras; they are listed, not fatal.
|
||||
core='^/usr/(bin/|lib/[^/]+\.so|lib/startplasma|lib/qt6/plugins/(platforms|wayland-|platformthemes|kf6/kwindowsystem)|lib/qt6/qml/org/kde/(kirigami|plasma)/)'
|
||||
if [ -s "$work/unresolved.txt" ]; then
|
||||
echo "== unresolved libraries or symbol versions:"
|
||||
sort -u "$work/unresolved.txt" | head -80
|
||||
annotate "unresolved: $(sed 's#^.*: *##' "$work/unresolved.txt" | sort | uniq -c | sort -rn | head -12 | tr -s ' ' | tr '\n' ';')"
|
||||
fail=1
|
||||
if grep -qE "$core" "$work/unresolved.txt"; then
|
||||
annotate "unresolved in the desktop's own programs: $(grep -E "$core" "$work/unresolved.txt" | sort -u | head -12 | tr -s ' \t' ' ' | tr '\n' ';')"
|
||||
fail=1
|
||||
fi
|
||||
notice "optional plugins with a missing dependency: $(grep -vE "$core" "$work/unresolved.txt" | cut -d: -f1 | sort -u | wc -l)"
|
||||
else
|
||||
echo "== every library in the package resolves in the runtime"
|
||||
fi
|
||||
|
||||
# KWin must start far enough to answer. plasmashell sets up its scene before it reads its arguments
|
||||
# and cannot without a compositor, so it is held to its libraries (above) and its answer only noted.
|
||||
for prog in kwin_wayland plasmashell; do
|
||||
if out=$(sudo chroot "$root" /usr/bin/env -i PATH=/usr/bin HOME=/root QT_QPA_PLATFORM=offscreen "/usr/bin/$prog" --version 2>&1); then
|
||||
echo "$out"
|
||||
else
|
||||
annotate "FAILED: $prog --version: $(echo "$out" | tail -3 | tr '\n' ' ')"; fail=1
|
||||
rc=0
|
||||
out=$(sudo chroot "$root" /usr/bin/env -i PATH=/usr/bin HOME=/root QT_QPA_PLATFORM=offscreen "/usr/bin/$prog" --version 2>&1) || rc=$?
|
||||
echo "$prog --version (exit $rc): $out"
|
||||
if [ "$rc" -ne 0 ]; then
|
||||
if [ "$prog" = kwin_wayland ]; then annotate "FAILED: $prog --version exit $rc: $(echo "$out" | tail -3 | tr '\n' ' ')"; fail=1
|
||||
else notice "$prog --version exit $rc: $(echo "$out" | tail -3 | tr '\n' ' ')"; fi
|
||||
fi
|
||||
done
|
||||
sudo rm -rf "$work"
|
||||
|
||||
Reference in new issue
Block a user