diff options
Diffstat (limited to '.github/workflows/build-linux.yml')
| -rw-r--r-- | .github/workflows/build-linux.yml | 771 |
1 files changed, 535 insertions, 236 deletions
diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 38b55845..8535f8b3 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -11,287 +11,586 @@ on: description: "Hamlib branch to build" required: false type: string - default: "4.7.0" + default: "4.7.2" arch: - description: "Linux target architecture: x86_64 or aarch64" + description: "Linux target architecture: x86_64, aarch64, or armhf" required: false type: string default: "x86_64" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + image_tag: + description: "Immutable GHCR image tag; empty resolves the current validated generation" + required: false + type: string + default: "" + image_source: + description: "Builder image source: internal or public-release" + required: false + type: string + default: "internal" + image_digest: + description: "Required sha256 digest for a public-release builder image" + required: false + type: string + default: "" + armhf_cross_image_digest: + description: "Required sha256 digest for the public-release ARMHF cross-builder" + required: false + type: string + default: "" + allow_stale_image: + description: "Allow a previously promoted image when a dependency refresh changed the recipe" + required: false + type: boolean + default: false + save_ccache: + description: "Save compiled objects for trusted builds" + required: false + type: boolean + default: false + validate_fortran_fallback: + description: "Build the x86_64 non-OpenMP common-library sentinel graph" + required: false + type: boolean + default: false + build_packages: + description: "Build, validate, and upload Linux packages and executable artifacts" + required: false + type: boolean + default: true + release_channel: + description: "Build release channel: DEVEL, RC, or GA" + required: false + type: string + default: "DEVEL" + rc_number: + description: "Release candidate number when release_channel is RC" + required: false + type: string + default: "" + # Also runnable on its own ("Run workflow" / gh workflow run) to build a single + # Linux arch without dispatching the full ci.yml matrix. GitHub only exposes + # workflow_dispatch when the trigger is on the default branch (develop), so this + # must be merged before it can be dispatched. This entry point supports focused + # single-architecture diagnosis and candidate-image validation; ARMHF also joins + # ci.yml's opt-in full-ci matrix. Inputs mirror workflow_call with standalone + # defaults: hamlib_branch matches what ci.yml / release.yml pass (4.7.2), and + # version is overridable via `-f version=...`. + workflow_dispatch: + inputs: + version: + description: "WSJT-X version string (artifact + package names)" + required: false + type: string + default: "3.2.0-devel" + hamlib_branch: + description: "Hamlib branch to build" + required: false + type: string + default: "4.7.2" + arch: + description: "Linux target architecture" + required: false + type: choice + options: + - x86_64 + - aarch64 + - armhf + default: "x86_64" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + image_tag: + description: "Immutable GHCR image tag; empty resolves the current validated generation" + required: false + type: string + default: "" + image_source: + description: "Builder image source" + required: false + type: choice + options: + - internal + - public-release + default: internal + image_digest: + description: "sha256 digest required with public-release image source" + required: false + type: string + default: "" + armhf_cross_image_digest: + description: "sha256 digest required for the public-release ARMHF cross-builder" + required: false + type: string + default: "" + allow_stale_image: + description: "Allow a previously promoted image when a dependency refresh changed the recipe" + required: false + type: boolean + default: false + save_ccache: + description: "Save compiled objects" + required: false + type: boolean + default: false + validate_fortran_fallback: + description: "Build the x86_64 non-OpenMP common-library sentinel graph" + required: false + type: boolean + default: false + build_packages: + description: "Build, validate, and upload Linux packages and executable artifacts" + required: false + type: boolean + default: true + release_channel: + description: "Build release channel" + required: false + type: choice + options: + - DEVEL + - RC + - GA + default: "DEVEL" + rc_number: + description: "Release candidate number when release_channel is RC" + required: false + type: string + default: "" + +# Architecture jobs are gated on `inputs.arch`. Each call from ci.yml / +# release.yml passes a single target, so exactly one build job runs per call. +# Splitting on arch +# keeps the per-arch runtime profile explicit at the job level: +# +# x86_64 — validated Noble container on ubuntu-24.04. +# aarch64 — validated GCC 13.4 Bookworm container on ubuntu-24.04-arm. This keeps the +# Bookworm glibc 2.36 + pre-t64 library baseline while using GCC 13 +# (issue #49). +# armhf — native x86_64-to-ARMHF GCC 13.4 cross-build followed by target +# tests and packaging in a Bookworm arm/v7 container under QEMU +# (issue #51). DigiPi / Pi Zero 2W class. +# +# The native jobs use the build-linux-payload composite action. ARMHF needs +# separate host-build and target-runtime phases, but shares their artifact +# validators and external artifact contracts. + +permissions: + contents: read + packages: read jobs: - build: - runs-on: ${{ inputs.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} + resolve-image: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + outputs: + image_tag: ${{ steps.resolve.outputs.image_tag }} + image_reference: ${{ steps.resolve.outputs.image_reference }} + cross_image_reference: ${{ steps.resolve.outputs.cross_image_reference }} steps: - - uses: actions/checkout@v6 - - - name: Install dependencies + - uses: actions/checkout@v7 + - id: resolve + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REQUESTED_TAG: ${{ inputs.image_tag }} + ARMHF_BUILD: ${{ inputs.arch == 'armhf' }} + ARCH: ${{ inputs.arch }} + IMAGE_SOURCE: ${{ inputs.image_source }} + IMAGE_DIGEST: ${{ inputs.image_digest }} + ARMHF_CROSS_IMAGE_DIGEST: ${{ inputs.armhf_cross_image_digest }} + REQUEST_REPOSITORY: ${{ github.repository }} + shell: bash run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential cmake gfortran \ - libfftw3-dev libboost-all-dev \ - qtbase5-dev qttools5-dev qtmultimedia5-dev libqt5serialport5-dev \ - libqt5sql5-sqlite libqt5websockets5-dev \ - libqt5multimedia5-plugins \ - libusb-1.0-0-dev libudev-dev libreadline-dev \ - autoconf automake libtool pkg-config \ - texinfo \ - dpkg-dev fakeroot \ - asciidoctor \ - rpm + case "$ARCH" in + x86_64) package=linux-noble; cross_package= ;; + aarch64) package=linux-arm64-bookworm; cross_package= ;; + armhf) package=linux-armv7-bookworm; cross_package=linux-armhf-cross-bookworm ;; + *) + echo "::error::Unsupported Linux architecture: $ARCH" + exit 2 + ;; + esac - - name: Cache pFUnit - id: pfunit-cache - uses: actions/cache@v5 - with: - path: pfunit-prefix - key: pfunit-linux-${{ inputs.arch }}-v4.9.0-${{ hashFiles('.github/workflows/build-linux.yml') }} + case "$IMAGE_SOURCE" in + internal) + if [ -n "$IMAGE_DIGEST" ] || [ -n "$ARMHF_CROSS_IMAGE_DIGEST" ]; then + echo "::error::image digests are valid only for public-release images" + exit 2 + fi + package_root=ghcr.io/wsjtx/wsjtx-internal + ;; + public-release) + if [ "$REQUEST_REPOSITORY" != WSJTX/wsjtx ]; then + echo "::error::Public release images may only be used by WSJTX/wsjtx" + exit 2 + fi + if [[ ! "$IMAGE_DIGEST" =~ ^sha256:[0-9a-f]{64}$ ]]; then + echo "::error::public-release images require an immutable sha256 digest" + exit 2 + fi + if [ "$ARCH" = armhf ]; then + if [[ ! "$ARMHF_CROSS_IMAGE_DIGEST" =~ ^sha256:[0-9a-f]{64}$ ]]; then + echo "::error::public-release ARMHF builds require an immutable cross-builder sha256 digest" + exit 2 + fi + elif [ -n "$ARMHF_CROSS_IMAGE_DIGEST" ]; then + echo "::error::armhf_cross_image_digest is valid only for ARMHF builds" + exit 2 + fi + if [ -z "$REQUESTED_TAG" ]; then + echo "::error::public-release images require their release-specific image_tag" + exit 2 + fi + package_root=ghcr.io/wsjtx/wsjtx + ;; + *) + echo "::error::Unsupported image_source: $IMAGE_SOURCE" + exit 2 + ;; + esac - - name: Build pFUnit - if: steps.pfunit-cache.outputs.cache-hit != 'true' - run: | - git clone --depth 1 --branch v4.9.0 --recursive \ - https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git pfunit-src - cmake -S pfunit-src -B pfunit-build \ - -DSKIP_MPI=YES \ - -DSKIP_OPENMP=YES \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/pfunit-prefix" - cmake --build pfunit-build -j$(nproc) - cmake --install pfunit-build + if [ -n "$REQUESTED_TAG" ]; then + IMAGE_TAG="$REQUESTED_TAG" .github/scripts/validate-ci-inputs.sh + echo "image_tag=$REQUESTED_TAG" >> "$GITHUB_OUTPUT" + elif [ "$ARMHF_BUILD" = true ]; then + RESOLVE_ARMHF=true .github/scripts/resolve-linux-ci-image-tag.py + else + .github/scripts/resolve-linux-ci-image-tag.py + fi - - name: Locate pFUnit config - id: pfunit - run: | - CONFIG=$(find "${GITHUB_WORKSPACE}/pfunit-prefix" -name PFUNITConfig.cmake | head -1) - if [ -z "$CONFIG" ]; then - echo "ERROR: PFUNITConfig.cmake not found under pfunit-prefix" - find "${GITHUB_WORKSPACE}/pfunit-prefix" -maxdepth 3 -type d - exit 1 + if [ "$IMAGE_SOURCE" = public-release ]; then + echo "image_reference=${package_root}/${package}@${IMAGE_DIGEST}" >> "$GITHUB_OUTPUT" + if [ "$ARCH" = armhf ]; then + echo "cross_image_reference=${package_root}/${cross_package}@${ARMHF_CROSS_IMAGE_DIGEST}" >> "$GITHUB_OUTPUT" + fi + else + image_tag="$(awk -F= '$1 == "image_tag" { print $2 }' "$GITHUB_OUTPUT" | tail -n 1)" + echo "image_reference=${package_root}/${package}:${image_tag}" >> "$GITHUB_OUTPUT" + if [ "$ARCH" = armhf ]; then + echo "cross_image_reference=${package_root}/${cross_package}:${image_tag}" >> "$GITHUB_OUTPUT" + fi fi - PFUNIT_DIR="$(dirname "$CONFIG")" - echo "Found PFUNITConfig.cmake at: $CONFIG" - echo "dir=${PFUNIT_DIR}" >> "$GITHUB_OUTPUT" - - name: Cache Hamlib - id: hamlib-cache - uses: actions/cache@v5 + build-x86_64: + needs: resolve-image + if: inputs.arch == 'x86_64' + runs-on: ubuntu-24.04 + timeout-minutes: 65 + container: + image: ${{ needs.resolve-image.outputs.image_reference }} + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v7 + - name: Validate workflow inputs + env: + WSJTX_VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + ARCH: ${{ inputs.arch }} + IMAGE_TAG: ${{ needs.resolve-image.outputs.image_tag }} + VALIDATE_FORTRAN_FALLBACK: ${{ inputs.validate_fortran_fallback }} + run: .github/scripts/validate-ci-inputs.sh + - uses: ./.github/actions/build-linux-payload with: - path: hamlib-prefix - key: hamlib-linux-${{ inputs.arch }}-${{ inputs.hamlib_branch }}-${{ hashFiles('.github/workflows/build-linux.yml') }} + arch: x86_64 + version: ${{ inputs.version }} + hamlib_branch: ${{ inputs.hamlib_branch }} + runtime_base: host + recache: ${{ inputs.recache }} + save_ccache: ${{ inputs.save_ccache }} + validate_fortran_fallback: ${{ inputs.validate_fortran_fallback }} + build_packages: ${{ inputs.build_packages }} + release_channel: ${{ inputs.release_channel }} + rc_number: ${{ inputs.rc_number }} + allow_stale_image: ${{ inputs.allow_stale_image }} - - name: Build Hamlib - if: steps.hamlib-cache.outputs.cache-hit != 'true' - run: | - git clone --depth 1 --branch "${{ inputs.hamlib_branch }}" \ - https://github.com/Hamlib/Hamlib.git hamlib-src - cd hamlib-src - ./bootstrap - ./configure \ - --prefix="${GITHUB_WORKSPACE}/hamlib-prefix" \ - --disable-shared --enable-static \ - --without-cxx-binding \ - CFLAGS="-g -O2 -fPIC -fdata-sections -ffunction-sections" \ - LDFLAGS="-Wl,--gc-sections" - make -j$(nproc) - make install + build-aarch64: + needs: resolve-image + if: inputs.arch == 'aarch64' + runs-on: ubuntu-24.04-arm + timeout-minutes: 45 + # The official GCC image adds GCC 13.4 without moving off the Bookworm + # glibc 2.36 and pre-t64 runtime baseline (issue #49). + container: + image: ${{ needs.resolve-image.outputs.image_reference }} + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v7 + - name: Validate workflow inputs + env: + WSJTX_VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + ARCH: ${{ inputs.arch }} + IMAGE_TAG: ${{ needs.resolve-image.outputs.image_tag }} + VALIDATE_FORTRAN_FALLBACK: ${{ inputs.validate_fortran_fallback }} + run: .github/scripts/validate-ci-inputs.sh + - uses: ./.github/actions/build-linux-payload + with: + arch: aarch64 + version: ${{ inputs.version }} + hamlib_branch: ${{ inputs.hamlib_branch }} + runtime_base: bookworm-gcc13.4 + recache: ${{ inputs.recache }} + save_ccache: ${{ inputs.save_ccache }} + validate_fortran_fallback: ${{ inputs.validate_fortran_fallback }} + build_packages: ${{ inputs.build_packages }} + release_channel: ${{ inputs.release_channel }} + rc_number: ${{ inputs.rc_number }} + allow_stale_image: ${{ inputs.allow_stale_image }} - - name: Configure - run: | - cmake -S . -B wsjtx-build \ - -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/hamlib-prefix;${GITHUB_WORKSPACE}/pfunit-prefix" \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DWSJT_SKIP_MANPAGES=ON \ - -DWSJT_BUILD_TESTS=ON \ - -DPFUNIT_DIR="${{ steps.pfunit.outputs.dir }}" \ - -Wno-dev + build-armhf: + needs: resolve-image + if: inputs.arch == 'armhf' + runs-on: ubuntu-24.04 + timeout-minutes: 160 + # Compile natively on x86_64 with a pinned GCC 13.4 cross-toolchain, then + # execute target tests and packaging in a clean Bookworm ARMv7 runtime. + # + # Keep JavaScript actions on the host: the runner's x86_64 Node runtime + # cannot execute in the ARMv7 container. Both explicit containers mount + # the checkout at /work so CTest paths remain stable across phases. + env: + VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + steps: + # setup-qemu-action runs on the host (job has no `container:`), + # mutating the host kernel's binfmt_misc table. With arm/v7 + # registered, subsequent `docker run --platform linux/arm/v7` + # invocations execute the container's arm/v7 init + binaries via + # qemu-arm-static. + - uses: docker/setup-qemu-action@v4 + with: + image: tonistiigi/binfmt:qemu-v10.2.3-68@sha256:400a4873b838d1b89194d982c45e5fb3cda4593fbfd7e08a02e76b03b21166f0 + platforms: linux/arm/v7 + - uses: actions/checkout@v7 + - name: Validate workflow inputs + env: + WSJTX_VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + ARCH: armhf + IMAGE_TAG: ${{ needs.resolve-image.outputs.image_tag }} + VALIDATE_FORTRAN_FALLBACK: ${{ inputs.validate_fortran_fallback }} + run: .github/scripts/validate-ci-inputs.sh - - name: Build - run: cmake --build wsjtx-build -j$(nproc) + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Run tests - id: ctest - run: ctest --output-on-failure --output-junit ctest-results.xml - working-directory: wsjtx-build + - name: Inspect ARMHF image pair + id: image env: - QT_QPA_PLATFORM: offscreen + CROSS_BUILDER_IMAGE: ${{ needs.resolve-image.outputs.cross_image_reference }} + RUNTIME_IMAGE: ${{ needs.resolve-image.outputs.image_reference }} + ALLOW_STALE_IMAGE: ${{ inputs.allow_stale_image }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + run: | + docker pull --platform linux/amd64 "$CROSS_BUILDER_IMAGE" + docker pull --platform linux/arm/v7 "$RUNTIME_IMAGE" + output_file=.armhf-image-verification-output + trap 'rm -f "$output_file"' EXIT + docker run --rm --platform linux/amd64 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e GITHUB_OUTPUT=/work/$output_file \ + -e WSJTX_CI_OUTPUT_PREFIX=cross_ \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH="$ALLOW_STALE_IMAGE" \ + "$CROSS_BUILDER_IMAGE" \ + bash .github/scripts/verify-armhf-ci-image.sh cross-builder armhf "$HAMLIB_BRANCH" + docker run --rm --platform linux/arm/v7 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e GITHUB_OUTPUT=/work/$output_file \ + -e WSJTX_CI_OUTPUT_PREFIX=runtime_ \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH="$ALLOW_STALE_IMAGE" \ + "$RUNTIME_IMAGE" \ + bash .github/scripts/verify-armhf-ci-image.sh runtime armhf "$HAMLIB_BRANCH" - - name: Publish test summary - if: always() && steps.ctest.conclusion != 'skipped' - working-directory: wsjtx-build - run: python3 ../.github/scripts/publish-ctest-summary.py "Linux ${{ inputs.arch }}" >> "$GITHUB_STEP_SUMMARY" + cross_generation=$(awk -F= '$1 == "cross_generation" { print $2 }' "$output_file") + runtime_generation=$(awk -F= '$1 == "runtime_generation" { print $2 }' "$output_file") + cross_toolchain_id=$(awk -F= '$1 == "cross_toolchain_id" { print $2 }' "$output_file") + runtime_toolchain_id=$(awk -F= '$1 == "runtime_toolchain_id" { print $2 }' "$output_file") + if [ "$cross_generation" != "$runtime_generation" ]; then + echo "ARMHF image generation mismatch: $cross_generation != $runtime_generation" >&2 + exit 1 + fi + if [ "$cross_toolchain_id" != "$runtime_toolchain_id" ]; then + echo "ARMHF toolchain identity mismatch: $cross_toolchain_id != $runtime_toolchain_id" >&2 + exit 1 + fi + cross_recipe_match=$(awk -F= '$1 == "cross_recipe_match" { print $2 }' "$output_file") + runtime_recipe_match=$(awk -F= '$1 == "runtime_recipe_match" { print $2 }' "$output_file") + recipe_match=false + if [ "$cross_recipe_match" = true ] && [ "$runtime_recipe_match" = true ]; then + recipe_match=true + fi + ccache_compatibility_id=$(awk -F= '$1 == "cross_ccache_compatibility_id" { print $2 }' "$output_file") + ccache_compiler_check=$(awk -F= '$1 == "cross_ccache_compiler_check" { print $2 }' "$output_file") + # Empty manifest values could coalesce caches from incompatible + # toolchains, so reject them before constructing any cache key. + if [ -z "$ccache_compatibility_id" ] || [ -z "$ccache_compiler_check" ]; then + echo "ARMHF image verification returned incomplete ccache identity" >&2 + exit 1 + fi + { + echo "generation=$cross_generation" + echo "recipe_match=$recipe_match" + echo "ccache_compatibility_id=$ccache_compatibility_id" + echo "ccache_compiler_check=$ccache_compiler_check" + } >> "$GITHUB_OUTPUT" - - name: Upload test results - if: always() && steps.ctest.conclusion != 'skipped' - uses: actions/upload-artifact@v7 + - name: Select armhf ccache key + id: ccache-key + env: + RECACHE: ${{ inputs.recache }} + run: .github/scripts/select-ccache-key-suffix.sh + + - name: Restore armhf ccache + id: ccache + uses: actions/cache/restore@v6 with: - name: ctest-results-linux-${{ inputs.arch }} - path: wsjtx-build/ctest-results.xml - if-no-files-found: ignore + path: .ccache-armhf + key: ccache-linux-armhf-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}-${{ github.sha }}${{ steps.ccache-key.outputs.suffix }} + restore-keys: | + ccache-linux-armhf-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}- + ccache-linux-armhf-${{ steps.image.outputs.ccache_compatibility_id }}- - - name: Verify binary + - name: Cross-build ARMHF binaries + env: + ARCH: armhf + CROSS_BUILDER_IMAGE: ${{ needs.resolve-image.outputs.cross_image_reference }} + RECACHE: ${{ inputs.recache }} + CCACHE_COMPILERCHECK: ${{ steps.image.outputs.ccache_compiler_check }} + WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH: ${{ inputs.allow_stale_image }} run: | - file wsjtx-build/jt9 - file wsjtx-build/jt9 | grep -q "ELF 64-bit" + ccache_args=() + if [ "$RECACHE" = true ]; then + ccache_args=(-e CCACHE_RECACHE=1) + fi + docker run --rm --platform linux/amd64 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e VERSION \ + -e HAMLIB_BRANCH \ + -e ARCH \ + -e WSJT_RELEASE_CHANNEL \ + -e WSJT_RC_NUMBER \ + -e CCACHE_DIR=/work/.ccache-armhf \ + -e CCACHE_COMPILERCHECK \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH \ + "${ccache_args[@]}" \ + "$CROSS_BUILDER_IMAGE" \ + bash .github/scripts/build-linux-armhf-cross.sh - # CMakeLists.txt:1989-2012 enables CPack's DEB generator when - # dpkg-buildpackage is on the path (provided by dpkg-dev, installed - # above). The DEB generator ignores CPACK_PACKAGE_FILE_NAME and - # uses its own CPACK_DEBIAN_FILE_NAME (default <pkg>_<ver>_<arch>.deb - # → wsjtx_3.0.1_amd64.deb regardless). Override that variable to - # align the filename with the AppImage/installer naming used by - # the rest of the pipeline. - - name: Package .deb + - name: Test and package under ARMv7 QEMU + id: armhf-runtime env: - VERSION: ${{ inputs.version }} - ARCH: ${{ inputs.arch }} + ARCH: armhf + RUNTIME_IMAGE: ${{ needs.resolve-image.outputs.image_reference }} + WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH: ${{ inputs.allow_stale_image }} + ARMHF_RUNTIME_PHASE: ${{ inputs.build_packages && 'all' || 'test' }} run: | - cd wsjtx-build - cpack -G DEB \ - -D "CPACK_DEBIAN_FILE_NAME=wsjtx-${VERSION}-linux-${ARCH}.deb" - DEB="wsjtx-${VERSION}-linux-${ARCH}.deb" - if [ ! -f "$DEB" ]; then - echo "::error::cpack -G DEB produced no .deb at expected path: $DEB" - ls -la *.deb 2>/dev/null || true - exit 1 - fi - ls -lh "$DEB" - file "$DEB" - dpkg-deb --info "$DEB" | head -20 + GITHUB_TOKEN="${{ github.token }}" docker run --rm --platform linux/arm/v7 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e VERSION \ + -e HAMLIB_BRANCH \ + -e ARCH \ + -e WSJT_RELEASE_CHANNEL \ + -e WSJT_RC_NUMBER \ + -e GITHUB_TOKEN \ + -e ARMHF_RUNTIME_PHASE \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH \ + "$RUNTIME_IMAGE" \ + bash .github/scripts/validate-linux-armhf-runtime.sh + + - name: Publish armhf test summary + if: always() + run: >- + python3 .github/scripts/publish-ctest-summary.py + "Linux armhf" wsjtx-build/ctest-results.xml + >> "$GITHUB_STEP_SUMMARY" + + - name: Upload armhf AppImage startup diagnostics + if: inputs.build_packages && failure() && steps.armhf-runtime.outcome == 'failure' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-startup-smoke-linux-armhf + path: wsjtx-build/appimage-startup-smoke.log + if-no-files-found: ignore + retention-days: 7 + # Artifacts produced inside the container land in $GITHUB_WORKSPACE + # via the bind-mount. Upload from the host where actions/upload- + # artifact runs natively. Same artifact names as the composite + # action's uploads so release.yml's all-platforms-ready gate + # pattern works unchanged. - name: Upload .deb + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-deb - path: wsjtx-build/wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}.deb + name: wsjtx-${{ inputs.version }}-linux-armhf-deb + path: wsjtx-build/wsjtx-${{ inputs.version }}-linux-armhf.deb if-no-files-found: error - - # RPM builds via the same CPack scaffolding the .deb step above - # uses. CMakeLists.txt:2014-2026 already auto-detects rpmbuild and - # sets the Fedora-style dependency list (qt5-qtbase >= 5.9, fftw- - # libs-single, boost-log, etc.); only the workflow side was - # missing. `-G RPM` is explicit so this step doesn't accidentally - # rebuild the .deb already produced above. - - name: Package RPM - working-directory: wsjtx-build - run: | - cpack -G RPM - ls -lh *.rpm - - - name: Smoke-test RPM - working-directory: wsjtx-build - run: | - RPM=$(ls *.rpm | head -1) - echo "Querying $RPM" - rpm -qpi "$RPM" - rpm -qpR "$RPM" - rpm -qpl "$RPM" | head -40 - # Confirm the core binaries are in the package. - rpm -qpl "$RPM" | grep -qE '/bin/wsjtx$' - rpm -qpl "$RPM" | grep -qE '/bin/jt9$' - + compression-level: 0 - name: Upload RPM + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-rpm + name: wsjtx-${{ inputs.version }}-linux-armhf-rpm path: wsjtx-build/*.rpm if-no-files-found: error - - - name: Install to AppDir - run: | - cmake --install wsjtx-build --prefix "${GITHUB_WORKSPACE}/AppDir/usr" - # linuxdeploy's desktop/icon integration needs these exact paths. - test -x AppDir/usr/bin/wsjtx - test -x AppDir/usr/bin/jt9 - test -x AppDir/usr/bin/ft8code - test -f AppDir/usr/share/applications/wsjtx.desktop - test -f AppDir/usr/share/pixmaps/wsjtx_icon.png - - - name: Package AppImage - env: - VERSION: ${{ inputs.version }} - ARCH: ${{ inputs.arch }} - # Core linuxdeploy is pinned to a dated release + SHA256 verify - # so an undetected upstream change fails the build instead of - # shipping. The Qt5 plugin stays on the rolling "continuous" - # channel because upstream has not cut a dated release since - # 1-alpha-20250213-1, which carries a filesystem_error bug on - # ubuntu-24.04 / Qt5.15 (missing qt5/plugins/mediaservice dir). - # When upstream publishes a newer dated plugin release, pin + - # verify it here too. - LINUXDEPLOY_TAG: "1-alpha-20251107-1" - run: | - case "$ARCH" in - x86_64) LINUXDEPLOY_SHA256="c20cd71e3a4e3b80c3483cef793cda3f4e990aca14014d23c544ca3ce1270b4d" ;; - aarch64) LINUXDEPLOY_SHA256="620095110d693282b8ebeb244a95b5e911cf8f65f76c88b4b47d16ae6346fcff" ;; - *) echo "::error::Unknown linuxdeploy arch: $ARCH"; exit 1 ;; - esac - curl -fsSL -o linuxdeploy.AppImage \ - "https://github.com/linuxdeploy/linuxdeploy/releases/download/${LINUXDEPLOY_TAG}/linuxdeploy-${ARCH}.AppImage" - curl -fsSL -o linuxdeploy-plugin-qt.AppImage \ - "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage" - echo "${LINUXDEPLOY_SHA256} linuxdeploy.AppImage" | sha256sum -c - - chmod +x linuxdeploy.AppImage linuxdeploy-plugin-qt.AppImage - - # --appimage-extract-and-run avoids FUSE on the hosted runner. - export OUTPUT="wsjtx-${VERSION}-linux-${ARCH}.AppImage" - ./linuxdeploy.AppImage --appimage-extract-and-run \ - --appdir AppDir \ - --plugin qt \ - --output appimage \ - --desktop-file AppDir/usr/share/applications/wsjtx.desktop \ - --icon-file AppDir/usr/share/pixmaps/wsjtx_icon.png - - ls -lh "$OUTPUT" - file "$OUTPUT" - - - name: Smoke-test AppImage payload - env: - VERSION: ${{ inputs.version }} - ARCH: ${{ inputs.arch }} - run: | - APPIMAGE="wsjtx-${VERSION}-linux-${ARCH}.AppImage" - ./"$APPIMAGE" --appimage-extract >/dev/null - test -x squashfs-root/usr/bin/wsjtx - test -x squashfs-root/usr/bin/jt9 - test -x squashfs-root/usr/bin/ft8code - test -x squashfs-root/usr/bin/wsprd - file squashfs-root/usr/bin/wsjtx | grep -q "ELF 64-bit" - # Qt5 libs should have been bundled by linuxdeploy-plugin-qt. - ls squashfs-root/usr/lib/ | grep -q "^libQt5Core\.so" - ls squashfs-root/usr/lib/ | grep -q "^libQt5Widgets\.so" - ls squashfs-root/usr/lib/ | grep -q "^libQt5Multimedia\.so" - # Verify Qt audio backend plugins were bundled. Without them, - # QAudioDeviceInfo::availableDevices() returns empty at runtime - # and the user sees "no audio devices" — observed in v3.0.1 on - # Linux Lite. linuxdeploy-plugin-qt only WARNS when these are - # absent on the build host, it doesn't fail. - # Linux shared objects are conventionally `lib*.so` so the - # bundled plugins are libqtaudio_alsa.so and libqtmedia_pulse.so. - audio_plugins=$(find squashfs-root -path '*/plugins/audio/*.so' 2>/dev/null) - if [ -z "$audio_plugins" ]; then - echo "::error::No Qt audio backend plugins (qtaudio_alsa/qtaudio_pulse) bundled in AppImage." - echo "::error::Install libqt5multimedia5-plugins on the build host so linuxdeploy-plugin-qt can find them." - echo "AppImage plugin tree:" - find squashfs-root -path '*/plugins/*' -name '*.so' 2>/dev/null | head -20 - exit 1 - fi - echo "Qt audio plugins bundled:" - echo "$audio_plugins" - rm -rf squashfs-root - + compression-level: 0 - name: Upload AppImage + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-AppImage - path: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}.AppImage + name: wsjtx-${{ inputs.version }}-linux-armhf-AppImage + path: wsjtx-${{ inputs.version }}-linux-armhf.AppImage if-no-files-found: error - + compression-level: 0 - name: Upload build artifacts + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }} + name: wsjtx-${{ inputs.version }}-linux-armhf path: | wsjtx-build/jt9 wsjtx-build/wsprd wsjtx-build/wsjtx + - name: Upload test results + if: always() + uses: actions/upload-artifact@v7 + with: + name: ctest-results-linux-armhf + path: wsjtx-build/ctest-results.xml + if-no-files-found: ignore + + - name: Report suppressed armhf ccache save + if: inputs.save_ccache && steps.image.outputs.recipe_match != 'true' + run: echo "::notice::Not saving armhf ccache because this build used a stale Linux CI image recipe" + + - name: Save armhf ccache + if: inputs.save_ccache && steps.image.outputs.recipe_match == 'true' && steps.ccache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: .ccache-armhf + key: ${{ steps.ccache.outputs.cache-primary-key }} |
