From 11327b277c6d5d75ef48363c5825cfe5620e875a Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Wed, 18 Nov 2026 17:05:12 +0100 Subject: [PATCH 1/4] Add README for GitHub workflows Describes the entry-point and reusable workflows, lint ranges, Docker image publishing, test reporting and workflow conventions. Developed with the assistance of generative AI. --- .github/workflows/README.md | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/README.md diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000000..bd9a21bdfd --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,81 @@ +# GitHub Actions workflows + +Workflows are split into **entry points** (triggered by GitHub events) and +**reusable building blocks** (file names starting with `_`, triggered only via +`workflow_call`). Entry points contain no build logic of their own; they just +compose the building blocks. + +## Entry points + +| Workflow | Trigger | Jobs | +|----------|---------|------| +| [`pr.yml`](pr.yml) (*PR*) | `pull_request`, manual `workflow_dispatch` | lint, build; then unit, UI and integration tests (after build succeeds) | +| [`branch.yml`](branch.yml) (*Branch*) | push to any branch except `master` | lint, build | +| [`merge.yml`](merge.yml) (*Merge to master*) | push to `master` | lint; build on Linux, Windows and macOS (product archives uploaded as artifacts); unit, UI and integration tests; Docker images for the services | +| [`release.yml`](release.yml) (*Release*) | push of any tag | Docker images for the services | +| [`report.yml`](report.yml) (*Test report*) | `workflow_run` after *PR* or *Merge to master* completes | publishes JUnit results as check runs | + +`pr.yml` and `branch.yml` use a `concurrency` group, so a new push cancels the +still-running workflow for the same PR/branch. + +## Reusable workflows + +| Workflow | Purpose | Inputs | +|----------|---------|--------| +| [`_lint.yml`](_lint.yml) | Runs [pre-commit](../../.pre-commit-config.yaml) on the files changed between two refs | `from-ref`, `to-ref` | +| [`_build.yml`](_build.yml) | `mvn install -DskipTests` | `os` (default `ubuntu-latest`), `upload-artifacts` (upload `phoebus-product/target/*.{tar.gz,zip}`) | +| [`_test.yml`](_test.yml) | Generic "run a test command, upload reports" job | `name`, `run`, `report-path` | +| [`_unit-test.yml`](_unit-test.yml) | `_test.yml` with `mvn verify` (surefire) | – | +| [`_ui-test.yml`](_ui-test.yml) | `_test.yml` with `xvfb-run -a mvn verify -P ui-tests` (TestFX, headless) | – | +| [`_integration-test.yml`](_integration-test.yml) | `-P it-tests,docker-tests` for `services/save-and-restore` against an Elasticsearch service container | – | +| [`_docker-image.yml`](_docker-image.yml) | Builds a service with Maven, then builds and pushes a multi-arch (amd64/arm64) image to `ghcr.io///` | `image-suffix`, `context`, `maven-args` | + +All jobs that need Java use the composite action +[`../actions/setup-java`](../actions/setup-java/action.yml) +(Temurin JDK with Maven dependency caching). + +### Lint ranges + +Only changed files are linted, because `master` is not yet clean for the +`end-of-file-fixer` / `trailing-whitespace` hooks: + +- PR: `pull_request.base.sha` … `pull_request.head.sha` +- Branch push: `origin/master` … pushed commit (`github.event.before` would be + the all-zero SHA on the first push of a new branch) +- Merge to master: `github.event.before` … pushed commit + +To reproduce locally: `pre-commit run --from-ref origin/master --to-ref HEAD`. + +### Docker images + +`merge.yml` and `release.yml` build images for these services (matrix): +`alarm-server`, `alarm-logger`, `save-and-restore`, `scan-server`. +Each is published as `service-`, built from `services/`. +`scan-server` additionally needs the `-Pexecutable-jar` Maven profile. +Image tags are derived by `docker/metadata-action` from the branch or tag name. + +### Test reports + +Test jobs upload their surefire/failsafe XML as artifacts named +`-reports` / `integration-test-reports`. Pull requests from forks only +get a read-only token, so they cannot publish check runs themselves. +`report.yml` therefore runs separately in the context of the base repository +(with `checks: write`), downloads all `*test-reports` artifacts of the +completed run and publishes them. It never checks out or runs PR code — keep +it that way (this is why the `dangerous-triggers` zizmor finding is +suppressed there). + +## Conventions + +- Default token permissions are `contents: read`; jobs that need more + (`packages: write` for Docker, `checks`/`pull-requests: write` for reports) + declare them explicitly. +- Third-party actions are pinned to a full commit SHA and + `persist-credentials: false` is set on checkout. The pre-commit hook + [zizmor](https://github.com/zizmorcore/zizmor) checks workflows for these + and other security issues. +- Untrusted or input-derived values are passed to `run:` steps through `env:` + variables rather than being interpolated with `${{ }}` directly. +- Action versions are bumped by Dependabot ([`../dependabot.yml`](../dependabot.yml)). + Manually pinned versions (JDK, Elasticsearch) are listed in + [`../CI_VERSIONS.md`](../CI_VERSIONS.md). From 30bc7bb1e4ae604be6071d7345914f40b7bcce47 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Wed, 18 Nov 2026 17:06:53 +0100 Subject: [PATCH 2/4] Add Linux aarch64 build to merge workflow Build the product on the ubuntu-24.04-arm runner in addition to x86_64 Linux, Windows and macOS. Developed with the assistance of generative AI. --- .github/workflows/README.md | 2 +- .github/workflows/merge.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index bd9a21bdfd..ebd3a5a298 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -11,7 +11,7 @@ compose the building blocks. |----------|---------|------| | [`pr.yml`](pr.yml) (*PR*) | `pull_request`, manual `workflow_dispatch` | lint, build; then unit, UI and integration tests (after build succeeds) | | [`branch.yml`](branch.yml) (*Branch*) | push to any branch except `master` | lint, build | -| [`merge.yml`](merge.yml) (*Merge to master*) | push to `master` | lint; build on Linux, Windows and macOS (product archives uploaded as artifacts); unit, UI and integration tests; Docker images for the services | +| [`merge.yml`](merge.yml) (*Merge to master*) | push to `master` | lint; build on Linux (x86_64 and aarch64), Windows and macOS (product archives uploaded as artifacts); unit, UI and integration tests; Docker images for the services | | [`release.yml`](release.yml) (*Release*) | push of any tag | Docker images for the services | | [`report.yml`](report.yml) (*Test report*) | `workflow_run` after *PR* or *Merge to master* completes | publishes JUnit results as check runs | diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index e12506a221..04259924d3 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest] uses: ./.github/workflows/_build.yml with: os: ${{ matrix.os }} From 10ffcb3289167a39045889d79f948f372c0e052d Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Wed, 18 Nov 2026 17:13:26 +0100 Subject: [PATCH 3/4] Tolerate failures of the Linux aarch64 build Add an allow-failure input to the reusable build workflow (setting continue-on-error on its job) and enable it for the ubuntu-24.04-arm matrix entry in the merge workflow. Developed with the assistance of generative AI. --- .github/workflows/README.md | 4 ++-- .github/workflows/_build.yml | 5 +++++ .github/workflows/merge.yml | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index ebd3a5a298..ec43fff176 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -11,7 +11,7 @@ compose the building blocks. |----------|---------|------| | [`pr.yml`](pr.yml) (*PR*) | `pull_request`, manual `workflow_dispatch` | lint, build; then unit, UI and integration tests (after build succeeds) | | [`branch.yml`](branch.yml) (*Branch*) | push to any branch except `master` | lint, build | -| [`merge.yml`](merge.yml) (*Merge to master*) | push to `master` | lint; build on Linux (x86_64 and aarch64), Windows and macOS (product archives uploaded as artifacts); unit, UI and integration tests; Docker images for the services | +| [`merge.yml`](merge.yml) (*Merge to master*) | push to `master` | lint; build on Linux (x86_64 and aarch64), Windows and macOS (product archives uploaded as artifacts; a failing aarch64 build does not fail the workflow); unit, UI and integration tests; Docker images for the services | | [`release.yml`](release.yml) (*Release*) | push of any tag | Docker images for the services | | [`report.yml`](report.yml) (*Test report*) | `workflow_run` after *PR* or *Merge to master* completes | publishes JUnit results as check runs | @@ -23,7 +23,7 @@ still-running workflow for the same PR/branch. | Workflow | Purpose | Inputs | |----------|---------|--------| | [`_lint.yml`](_lint.yml) | Runs [pre-commit](../../.pre-commit-config.yaml) on the files changed between two refs | `from-ref`, `to-ref` | -| [`_build.yml`](_build.yml) | `mvn install -DskipTests` | `os` (default `ubuntu-latest`), `upload-artifacts` (upload `phoebus-product/target/*.{tar.gz,zip}`) | +| [`_build.yml`](_build.yml) | `mvn install -DskipTests` | `os` (default `ubuntu-latest`), `upload-artifacts` (upload `phoebus-product/target/*.{tar.gz,zip}`), `allow-failure` (set `continue-on-error` on the job) | | [`_test.yml`](_test.yml) | Generic "run a test command, upload reports" job | `name`, `run`, `report-path` | | [`_unit-test.yml`](_unit-test.yml) | `_test.yml` with `mvn verify` (surefire) | – | | [`_ui-test.yml`](_ui-test.yml) | `_test.yml` with `xvfb-run -a mvn verify -P ui-tests` (TestFX, headless) | – | diff --git a/.github/workflows/_build.yml b/.github/workflows/_build.yml index 1abd1fe4b8..c3cc8ecafd 100644 --- a/.github/workflows/_build.yml +++ b/.github/workflows/_build.yml @@ -11,6 +11,10 @@ on: description: Upload the product tarball/zip (used by the master build). type: boolean default: false + allow-failure: + description: Do not fail the calling workflow if this build fails. + type: boolean + default: false permissions: contents: read @@ -18,6 +22,7 @@ permissions: jobs: build: runs-on: ${{ inputs.os }} + continue-on-error: ${{ inputs.allow-failure }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 04259924d3..a59561aab6 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -23,6 +23,8 @@ jobs: with: os: ${{ matrix.os }} upload-artifacts: true + # Linux aarch64 is not yet a supported platform; report but tolerate failures + allow-failure: ${{ matrix.os == 'ubuntu-24.04-arm' }} unit-test: uses: ./.github/workflows/_unit-test.yml ui-test: From 27cd8dc1f572c85ebba55962c25ceed627745628 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Thu, 19 Nov 2026 10:00:40 +0100 Subject: [PATCH 4/4] Match any Ubuntu arm runner for tolerated build failures Developed with the assistance of generative AI. --- .github/workflows/merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index a59561aab6..0b927cfc47 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -24,7 +24,7 @@ jobs: os: ${{ matrix.os }} upload-artifacts: true # Linux aarch64 is not yet a supported platform; report but tolerate failures - allow-failure: ${{ matrix.os == 'ubuntu-24.04-arm' }} + allow-failure: ${{ startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.os, '-arm') }} unit-test: uses: ./.github/workflows/_unit-test.yml ui-test: