neiam
/home-assistant-plasmoid
Home Assistant Plasmoid
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
Validate: a QML check that runs, and rsync for the test package
cfb03ed · gmorell · 2026-11-05 22:33
Message
{commit_body(@commit)}
Files changed
modified
.github/workflows/validate.yml
+23
−10
@@ -73,19 +73,32 @@ jobs:
| 73 | 73 | run: | |
| 74 | 74 | echo "🔍 Checking QML files..." |
| 75 | 75 | |
| 76 | − # Install Qt6 QML tools | |
| 76 | + # Install Qt6 QML tools (and rsync, for the package step below — | |
| 77 | + # the forge runner's image doesn't ship it) | |
| 77 | 78 | sudo apt-get update |
| 78 | − sudo apt-get install -y qt6-declarative-dev-tools | |
| 79 | − | |
| 80 | − # Find and check all QML files | |
| 81 | − find . -name "*.qml" -type f | while read -r qml_file; do | |
| 79 | + sudo apt-get install -y qt6-declarative-dev-tools rsync | |
| 80 | + | |
| 81 | + # Debian/Ubuntu install the Qt 6 tools here, not on PATH. | |
| 82 | + qtbin=/usr/lib/qt6/bin | |
| 83 | + | |
| 84 | + # qmlformat parses without resolving imports, so it fails on a | |
| 85 | + # genuine syntax error and nothing else — that's the gate. | |
| 86 | + # qmllint goes further but can't see the Plasma/Kirigami modules | |
| 87 | + # on this runner, so its findings are printed, not enforced. | |
| 88 | + failed=0 | |
| 89 | + while read -r qml_file; do | |
| 82 | 90 | echo "Checking: $qml_file" |
| 83 | − if ! qmlls "$qml_file" 2>/dev/null; then | |
| 84 | − echo "⚠️ QML syntax check failed for: $qml_file" | |
| 85 | − # Don't fail the build for QML syntax issues as qmlls might not work perfectly in CI | |
| 91 | + if ! "$qtbin/qmlformat" "$qml_file" >/dev/null; then | |
| 92 | + echo "❌ QML syntax error in: $qml_file" | |
| 93 | + failed=1 | |
| 86 | 94 | fi |
| 87 | − done | |
| 88 | − | |
| 95 | + "$qtbin/qmllint" "$qml_file" || true | |
| 96 | + done < <(find . -name "*.qml" -type f -not -path './.git/*') | |
| 97 | + | |
| 98 | + if [[ $failed -ne 0 ]]; then | |
| 99 | + exit 1 | |
| 100 | + fi | |
| 101 | + | |
| 89 | 102 | echo "✅ QML syntax check completed" |
| 90 | 103 | |
| 91 | 104 | - name: Create test package |
Parents: e813c94