diff options
Diffstat (limited to '.github/workflows/build-windows.yml')
| -rw-r--r-- | .github/workflows/build-windows.yml | 125 |
1 files changed, 105 insertions, 20 deletions
diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index c2dca58d..8cb10042 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -12,6 +12,11 @@ on: required: false type: string default: "4.7.2" + cold_build: + description: "Bypass workflow dependency and compiler caches without saving them" + required: false + type: boolean + default: false recache: description: "Force ccache to recompile and refresh cached objects" required: false @@ -22,16 +27,6 @@ on: required: false type: boolean default: false - 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: "" outputs: installer-artifact-id: description: "Installer artifact id, for the SignPath submit step" @@ -44,6 +39,8 @@ on: # what ci.yml / release.yml actually pass (4.7.2, not the workflow_call legacy # default), and version defaults to a clearly-marked devel string -- overridable # via `-f version=...` -- so a manual build is never mistaken for a release. + # release_channel and prerelease_number exist only here, to override + # release-state.txt. workflow_dispatch: inputs: version: @@ -56,6 +53,11 @@ on: required: false type: string default: "4.7.2" + cold_build: + description: "Bypass workflow dependency and compiler caches without saving them" + required: false + type: boolean + default: false recache: description: "Force ccache to recompile and refresh cached objects" required: false @@ -72,11 +74,12 @@ on: type: choice options: - DEVEL + - BETA - RC - GA default: "DEVEL" - rc_number: - description: "Release candidate number when release_channel is RC" + prerelease_number: + description: "Prerelease number when release_channel is BETA or RC" required: false type: string default: "" @@ -94,7 +97,7 @@ jobs: VERSION: ${{ inputs.version }} HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} - WSJT_RC_NUMBER: ${{ inputs.rc_number }} + WSJT_PRERELEASE_NUMBER: ${{ inputs.prerelease_number }} defaults: run: shell: msys2 {0} @@ -124,7 +127,7 @@ jobs: with: msystem: MINGW64 update: true - cache: true + cache: ${{ !inputs.cold_build }} install: >- git make tar mingw-w64-x86_64-gcc @@ -161,6 +164,7 @@ jobs: - name: Restore ccache id: ccache + if: ${{ !inputs.cold_build }} uses: actions/cache/restore@v6 with: path: .ccache @@ -171,7 +175,11 @@ jobs: - name: Configure ccache run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") - echo "CCACHE_DIR=${WORKSPACE}/.ccache" >> "$GITHUB_ENV" + if [ "${{ inputs.cold_build }}" = "true" ]; then + echo "CCACHE_DIR=$(mktemp -d)" >> "$GITHUB_ENV" + else + echo "CCACHE_DIR=${WORKSPACE}/.ccache" >> "$GITHUB_ENV" + fi echo "ccache recache: ${{ inputs.recache }}" if [ "${{ inputs.recache }}" = "true" ]; then echo "CCACHE_RECACHE=1" >> "$GITHUB_ENV" @@ -189,6 +197,7 @@ jobs: boost_source_sha256: ${{ env.BOOST_SOURCE_SHA256 }} windows_api_floor: ${{ env.WSJT_WINDOWS_API_FLOOR }} hamlib_branch: ${{ inputs.hamlib_branch }} + cold_build: ${{ inputs.cold_build }} save_caches: ${{ github.event_name != 'pull_request' }} - name: Install OmniRig @@ -231,9 +240,10 @@ jobs: -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -std=legacy" \ -DWSJT_SKIP_MANPAGES=ON \ -DWSJT_ENABLE_TESTS=ON \ + -DWSJT_ENABLE_GUI_SMOKE_TESTS=ON \ -DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \ -DWSJT_RELEASE_CHANNEL="${WSJT_RELEASE_CHANNEL}" \ - -DWSJT_RC_NUMBER="${WSJT_RC_NUMBER}" \ + -DWSJT_PRERELEASE_NUMBER="${WSJT_PRERELEASE_NUMBER}" \ -DPFUNIT_DIR="${{ steps.windows-deps.outputs.pfunit_dir }}" \ -DGFTL_DIR="${{ steps.windows-deps.outputs.gftl_dir }}" \ -DGFTL_SHARED_DIR="${{ steps.windows-deps.outputs.gftl_shared_dir }}" \ @@ -241,6 +251,7 @@ jobs: -Wno-dev - name: Build and test targets + id: compile run: cmake --build wsjtx-build -j$(nproc) - name: Show ccache stats @@ -248,11 +259,11 @@ jobs: run: ccache --show-stats - name: Report suppressed ccache save - if: ${{ (inputs.save_ccache || inputs.recache) && github.ref != 'refs/heads/develop' }} + if: ${{ !inputs.cold_build && (inputs.save_ccache || inputs.recache) && github.ref != 'refs/heads/develop' }} run: echo "::notice::Not saving ccache because shared compiler caches are published only from develop" - name: Save ccache - if: ${{ success() && (inputs.save_ccache || inputs.recache) && github.ref == 'refs/heads/develop' && steps.ccache.outputs.cache-hit != 'true' }} + if: ${{ !inputs.cold_build && success() && (inputs.save_ccache || inputs.recache) && github.ref == 'refs/heads/develop' && steps.ccache.outputs.cache-hit != 'true' }} uses: actions/cache/save@v6 with: path: .ccache @@ -271,6 +282,18 @@ jobs: # libhamlib-4.dll in. export PATH="${{ steps.windows-deps.outputs.boost_prefix }}/lib:${{ steps.windows-deps.outputs.hamlib_prefix }}/bin:${PATH}" ctest --output-on-failure --output-junit ctest-results.xml + python3 - <<'PY' + import xml.etree.ElementTree as ET + + root = ET.parse('ctest-results.xml').getroot() + for name in ('test_wsjtx_live_audio_jtty', 'test_wsjtx_jtty_tx_loopback', + 'test_wsjtx_jt9_wav', 'test_wsjtx_jt65_wav', 'test_wsjtx_q65_wav', + 'test_wsjtx_fst4_wav', 'test_wsjtx_fst4w_wav'): + test = root.find(f".//testcase[@name='{name}']") + if test is None or test.find('failure') is not None or test.find('skipped') is not None: + raise SystemExit(f'{name} was not executed successfully') + print(f'{name} passed') + PY working-directory: wsjtx-build - name: Publish test summary @@ -339,12 +362,36 @@ jobs: WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") .github/scripts/smoke-launch-windows.sh "${WORKSPACE}/stage-main/bin/jt9.exe" --help + - name: Package release tarballs + run: | + WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") + .github/scripts/package-cli-tools.sh \ + --platform windows \ + --version "${VERSION}" \ + --arch x86_64 \ + --groups "${WORKSPACE}/CMake/release-tarballs.txt" \ + --source "${WORKSPACE}/wsjtx-build" \ + --dll-dir "${WORKSPACE}/stage-main/bin" \ + --system-dir "$(cygpath -S)" \ + --out "${WORKSPACE}/release-tarballs" + + - name: Smoke-launch release tarballs (clean PATH) + run: | + WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") + .github/scripts/smoke-release-tarballs.sh \ + --platform windows \ + --version "${VERSION}" \ + --target windows-x86_64 \ + --groups "${WORKSPACE}/CMake/release-tarballs.txt" \ + --dir "${WORKSPACE}/release-tarballs" + # Emit an NSIS installer containing the full executable set # (wsjtx.exe, map65.exe, jt9, wsprd, fmtave, fcal, fmeasure + WSJT_BUILD_UTILS # ft8code/jt65code/... + rigctl wrappers + Qt runtime via bundle_fixup). # CMakeLists.txt:1989-1990 sets CPACK_GENERATOR=NSIS on WIN32 and # CPACK_MONOLITHIC_INSTALL=1 packages every install() target. - name: Package NSIS installer + id: package_installer run: | cd wsjtx-build # Override CPACK_PACKAGE_VERSION and @@ -357,16 +404,38 @@ jobs: # wsjtx-<inputs.version>-win64.exe. release.yml's prepare job # enforces numeric-base parity; this override covers the # suffix gap. + # MSYS2 supplies amd64 plugins; NSIS 3.13 can select x86 by default. cpack_args=( -G NSIS -D CPACK_PACKAGE_VERSION="${VERSION}" -D CPACK_PACKAGE_FILE_NAME="wsjtx-${VERSION}-win64" + -D 'CPACK_NSIS_EXTRA_DEFINES=Target amd64-unicode' ) if [ "${CPACK_VERBOSE:-0}" = "1" ]; then cpack_args+=(-V) fi - cpack "${cpack_args[@]}" - ls -la *.exe + if cpack "${cpack_args[@]}"; then + ls -la *.exe + else + cpack_status=$? + for nsis_log in _CPack_Packages/*/NSIS/NSISOutput.log; do + [ -f "${nsis_log}" ] || continue + echo "::group::${nsis_log}" + cat "${nsis_log}" + echo "::endgroup::" + done + exit "${cpack_status}" + fi + + - name: Upload NSIS failure diagnostics + if: ${{ failure() && steps.package_installer.outcome == 'failure' }} + uses: actions/upload-artifact@v7 + with: + name: nsis-diagnostics-windows + path: | + wsjtx-build/_CPack_Packages/*/NSIS/NSISOutput.log + wsjtx-build/_CPack_Packages/*/NSIS/project.nsi + if-no-files-found: warn - name: Verify installer has no Authenticode signature shell: pwsh @@ -392,3 +461,19 @@ jobs: wsjtx-build/jt9.exe wsjtx-build/wsprd.exe wsjtx-build/wsjtx.exe + + - name: Upload release tarballs + uses: ./.github/actions/upload-release-tarballs + with: + version: ${{ inputs.version }} + target: windows-x86_64 + directory: release-tarballs + + - name: Summarize native caches + if: always() + shell: bash + env: + CACHE_STEPS: ${{ toJSON(steps) }} + COLD_BUILD: ${{ inputs.cold_build }} + RECACHE: ${{ inputs.recache }} + run: python .github/scripts/summarize-native-caches.py --compiler >> "$GITHUB_STEP_SUMMARY" |
