mirror of
https://github.com/logos-co/logos-verified-proxy-ui.git
synced 2026-08-27 13:11:13 +00:00
This repo had no CI. `nix build` alone would be close to worthless here: mkLogosQmlModule only copies src/qml, so a green build is perfectly compatible with `import Logos.Thmee` — and an unresolved import takes the WHOLE view down at runtime, with the only useful message going to the host's stderr. So CI runs the two pre-flight gates from the README as well. The design system is checked out as a plain repo rather than added as a flake input: it is static-linked into the host binary, so the plugin declares nothing, and adding a lock entry for a lint's sake would be a real dependency for a tooling need. Gate B's pass condition is exit 124, which deserves the comment it has: the view is an Item rather than a Window, so a healthy load runs the event loop until timeout kills it. Measured all three cases — healthy 124, bad import 2, unknown property 2 — because the first draft treated a zero exit as success and would have been permanently red on good input. The grep remains for style-customization rejections, which arrive as qWarnings and change no exit code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
85 lines
3.4 KiB
YAML
85 lines
3.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
- uses: cachix/cachix-action@v15
|
|
with:
|
|
name: logos-co
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
|
|
- name: Build plugin and package
|
|
run: nix build -L .#lgx
|
|
|
|
qml:
|
|
# `nix build` proves NOTHING about the QML: mkLogosQmlModule only copies
|
|
# src/qml, so a green build is perfectly compatible with `import
|
|
# Logos.Thmee` — and an unresolved import takes the whole view down at
|
|
# runtime, with the only useful message going to the host's stderr. These
|
|
# are the two pre-flight gates from the README.
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# The design system is NOT a flake input: it is static-linked into the
|
|
# host binary, so the plugin declares nothing. Its SOURCE tree is still
|
|
# what qmllint needs to resolve Logos.* — checked out here rather than
|
|
# added to the lock for a lint's sake.
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
repository: logos-co/logos-design-system
|
|
path: .design-system
|
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
- uses: cachix/cachix-action@v15
|
|
with:
|
|
name: logos-co
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
|
|
- name: Gate A — static (imports, type and property names)
|
|
run: |
|
|
nix shell nixpkgs#qt6.qtdeclarative -c bash -c '
|
|
QTQML=$(dirname $(dirname $(readlink -f $(command -v qmllint))))/lib/qt-6/qml
|
|
qmllint -I "$QTQML" -I .design-system/src/qml \
|
|
-W 0 --unqualified disable src/qml/Main.qml'
|
|
|
|
- name: Gate B — instantiate every component for real
|
|
run: |
|
|
nix shell nixpkgs#qt6.qtdeclarative nixpkgs#qt6.qtsvg -c bash -c '
|
|
QTQML=$(dirname $(dirname $(readlink -f $(command -v qmllint))))/lib/qt-6/qml
|
|
# Basic is load-bearing: under a platform style the design system'"'"'s
|
|
# own contentItem overrides are REJECTED, which reads as a bug in
|
|
# this panel. Both hosts force it; a bare `qml` does not.
|
|
QT_QUICK_CONTROLS_STYLE=Basic QT_QPA_PLATFORM=offscreen \
|
|
timeout 60 qml -I "$QTQML" -I .design-system/src/qml src/qml/Main.qml \
|
|
> /tmp/qml.log 2>&1
|
|
status=$?
|
|
cat /tmp/qml.log
|
|
# 124 IS THE PASS. The view is an Item, not a Window, so a healthy
|
|
# load runs the event loop until timeout kills it; measured, qml
|
|
# exits 2 for a bad import and for an unknown property, and only
|
|
# reaches 124 when every component constructed.
|
|
if [ $status -ne 124 ]; then
|
|
echo "::error::qml exited $status (expected 124 = loaded and still running)"
|
|
exit 1
|
|
fi
|
|
# Style-customization rejections arrive as qWarnings and would not
|
|
# have changed the exit code.
|
|
if grep -qE "does not support customization|Cannot assign|was not found" /tmp/qml.log; then
|
|
echo "::error::QML component errors above"; exit 1
|
|
fi'
|