Files
Anthias/.github/workflows/docker-test.yaml
Viktor Petersson 9baf750639 refactor(webview): inline build into viewer image as multi-stage (#2855)
* refactor(webview): inline build into viewer image as multi-stage

- Add docker/Dockerfile.qt5-webview-builder.j2 — two-stage Qt 5
  cross-compile (sysroot + host) included from Dockerfile.viewer.j2
  for pi2/pi3
- Inline a Qt 6 webview-builder stage in Dockerfile.viewer.j2
  (qt6-base-dev + qt6-webengine-dev + qmake6) for pi4-64/pi5/x86
- Replace runtime curl-from-releases blocks with
  COPY --from=webview-builder for binary, resources, and (Qt 5)
  the qt5pi runtime tree
- Drop WEBVIEW_VERSION pinning; the Qt 5 toolchain stays frozen at
  WebView-v2026.04.1 via a qt5_toolchain_url constant
- Delete .github/workflows/build-webview.yaml and the dead
  build-webview.yaml / webview/** path-ignore exclusions in
  docker-build.yaml, docker-test.yaml, generate-openapi-schema.yml
  so webview source changes now trigger viewer rebuilds
- Delete redundant Qt 6 builder scaffolding (webview/scripts/,
  webview/docker/, webview/build_qt6.sh, build_webview_with_qt5.sh)
- Trim BUILD_WEBVIEW + WEBVIEW_VERSION from build_qt5.sh and
  rebuild_qt5_toolchain.sh; webview/Dockerfile and build_qt5.sh
  remain as offline tooling for Qt 5 toolchain rebuilds
- Rewrite webview/README.md to describe the in-tree build flow

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(webview): address Copilot review feedback

- Drop unused ccache install + cache mount from both Qt 6 and Qt 5
  webview-builder stages — webview is 3 .cpp files; ccache wiring
  (especially through Linaro's cross-gcc) wouldn't pay back the
  setup cost
- Vendor sysroot-relativelinks.py at webview/ instead of curl-ing
  it from raw.githubusercontent.com/.../master at build time
  (eliminates supply-chain risk and the non-reproducible reference)
- SHA256-pin the Linaro gcc-7.4.1 tarball — Linaro doesn't publish
  signed manifests for this legacy build, so the hash is the trust
  anchor
- Install python3 in the host builder stage (needed by the
  vendored sysroot-relativelinks.py)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(webview): invoke sysroot-relativelinks via explicit python3

The vendored script is committed at mode 755 and is callable directly
today, but invoking it as `python3 /usr/local/bin/sysroot-relativelinks.py`
removes the hidden dependency on the file-mode bit surviving every
clone/checkout path. python3 is already installed two layers up in the
same stage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(webview): pin Qt5 builder to amd64 and vendor sysroot script in offline path

Qt5 webview-builder stage was pinned to $BUILDPLATFORM, but the Linaro
7.4.1 cross-compiler it downloads is x86_64-only — arm64 build hosts
(e.g. Apple Silicon) would attempt to run an x86_64 binary natively
and fail. Pin the stage to linux/amd64 explicitly; non-amd64 hosts
will execute it under QEMU.

webview/Dockerfile (the offline Qt5 toolchain rebuild path) was still
fetching sysroot-relativelinks.py via unpinned wget from
raw.githubusercontent.com/.../master. The script is already vendored
at webview/sysroot-relativelinks.py at a pinned upstream commit, and
the rebuild script uses webview/ as the docker context, so switch to
COPY for a reproducible offline rebuild path.

Also update webview/build_qt5.sh to invoke the script via explicit
python3 to match the inline builder change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(lint): exclude vendored sysroot-relativelinks.py from ruff/mypy

The script is vendored byte-identical from a pinned Yocto/poky upstream
commit (see file header). Reformatting it via ruff or annotating it for
mypy strict mode would put the file off-pin and silently break the
provenance comment that says "vendored from <commit>". Adding a
project-style copy is the wrong tradeoff: the cost of every future
upstream sync would be re-applying our edits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 08:46:41 +01:00

48 lines
1019 B
YAML

name: Run Unit Tests
on:
push:
branches:
- master
paths:
- '**/**'
- '!.editorconfig'
- '!README.md'
- '!CONTRIBUTING.md'
- '!website/**'
- '!.github/workflows/build-balena-disk-image.yaml'
- '!.github/release.yml'
- '!.github/dependabot.yml'
- '!docs/**'
- '!.cursor/**'
- '!.claude/**'
pull_request:
branches:
- master
paths:
- '**/**'
- '!.editorconfig'
- '!README.md'
- '!CONTRIBUTING.md'
- '!website/**'
- '!.github/workflows/build-balena-disk-image.yaml'
- '!.github/release.yml'
- '!.github/dependabot.yml'
- '!docs/**'
- '!.cursor/**'
- '!.claude/**'
workflow_call:
jobs:
run-typescript-tests:
uses: ./.github/workflows/test-runner.yml
with:
test-type: 'typescript'
python-version: '3.13'
run-python-tests:
uses: ./.github/workflows/test-runner.yml
with:
test-type: 'python'
python-version: '3.13'