name: CI on: push: branches: [develop, "release/**"] pull_request: branches: [develop, "release/**"] # `labeled` is added to the defaults (opened/synchronize/reopened) so # that applying `full-ci`, `sanitizers`, or `thread-sanitizer` to an # already-open PR triggers # a fresh run that includes the requested opt-in jobs (see the gates below). types: [opened, synchronize, reopened, labeled] workflow_dispatch: inputs: recache: description: "Force recompilation and persist refreshed ccache objects on develop" required: false type: boolean default: false save_ccache: description: "Persist Linux ccache objects without forcing recompilation on develop" required: false type: boolean default: false armhf_image_tag: description: "Immutable paired ARMHF image tag; empty resolves the promoted generation" required: false type: string default: "" concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read packages: read jobs: # Single source of truth for the project version string: read it from # release-state.txt so CI and release builds cannot disagree. Strip the # optional fourth tweak segment (3.0.0.0 → 3.0.0) to match the 3-part # shape release.yml derives from build/v tags. prepare: if: >- github.repository != 'WSJTX/wsjtx' || github.event_name != 'push' || !startsWith(github.ref, 'refs/heads/release/') runs-on: ubuntu-latest timeout-minutes: 10 outputs: version: ${{ steps.v.outputs.version }} linux_image_tag: ${{ steps.linux-image.outputs.image_tag }} armhf_image_tag: ${{ steps.armhf-image.outputs.image_tag }} save_linux_ccache: ${{ steps.ccache-policy.outputs.save_ccache }} build_linux_packages: ${{ steps.packaging-policy.outputs.build_packages }} steps: - uses: actions/checkout@v7 - name: Validate workflow job timeouts run: .github/scripts/validate-workflow-timeouts.py - name: Run CI policy self-tests run: | .github/scripts/validate-ci-inputs.sh --self-test .github/scripts/is-linux-ci-image-input.sh --self-test .github/scripts/select-ccache-key-suffix.sh --self-test .github/scripts/select-linux-ccache-save.sh --self-test .github/scripts/select-linux-packaging.sh --self-test .github/scripts/test-linux-ccache-compiler-signature.sh .github/scripts/test-verify-linux-ci-image.sh python3 -m unittest discover -s .github/scripts/tests -p 'test_*.py' - id: v run: | STATE=$(python3 .github/scripts/release-policy.py read-state) VERSION=$(jq -r .version <<<"$STATE") echo "Derived version from release-state.txt: $VERSION" echo "version=$VERSION" >> "$GITHUB_OUTPUT" # PRs can consume develop caches, so only trusted develop executions may # publish the Linux cache shared with later pull-request builds. - id: ccache-policy name: Select Linux ccache save policy env: EVENT_NAME: ${{ github.event_name }} REQUEST_SAVE_CCACHE: ${{ inputs.save_ccache || false }} RECACHE: ${{ inputs.recache || false }} run: .github/scripts/select-linux-ccache-save.sh # Routine PRs and develop pushes build and test without packaging. # Full CI, manual runs, and release-branch pushes also validate packages. - id: packaging-policy name: Select Linux packaging policy env: EVENT_NAME: ${{ github.event_name }} FULL_CI: ${{ contains(github.event.pull_request.labels.*.name, 'full-ci') }} run: .github/scripts/select-linux-packaging.sh - id: linux-image name: Resolve Linux CI image generation env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: .github/scripts/resolve-linux-ci-image-tag.py - id: armhf-image name: Resolve ARMHF CI image generation if: >- github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REQUESTED_TAG: ${{ inputs.armhf_image_tag || '' }} run: | if [[ -n "$REQUESTED_TAG" ]]; then echo "Using requested ARMHF CI image generation: $REQUESTED_TAG" echo "image_tag=$REQUESTED_TAG" >> "$GITHUB_OUTPUT" else RESOLVE_ARMHF=true .github/scripts/resolve-linux-ci-image-tag.py fi # Two-tier CI to conserve Actions minutes. The default path runs one Linux # x86_64 smoke leg; sanitizer and broader platform coverage are opt-in. # # * Default (every push / PR to develop): Linux x86_64 only -- `linux`. # * ASan + UBSan: runs on PRs carrying `sanitizers` or `full-ci`. # * TSan: runs only on PRs carrying `thread-sanitizer`. # * Opt-in matrix (`linux-arm`, `linux-armhf`, macos, macos-intel, windows): runs when a # PR carries the `full-ci` label, or when the workflow is started manually # ("Run workflow" / workflow_dispatch). Release builds are unaffected -- # they run the full matrix via release.yml on build/v* tags. # # Every non-prepare leg also `needs: linux`, so a break that fails # everywhere fails fast on the cheapest runner before any costly leg # starts, instead of burning them in parallel. `prepare` stays in `needs` # for its version output. macos: needs: [prepare, linux] # Opt-in only -- see the two-tier note above. if: >- github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-macos.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" arch: "arm64" runner: "macos-15" deployment_target: "11.0" recache: ${{ inputs.recache || false }} macos-intel: needs: [prepare, linux] # Opt-in only -- see the two-tier note above. if: >- github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-macos.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" arch: "x86_64" runner: "macos-15-intel" deployment_target: "10.13" recache: ${{ inputs.recache || false }} linux: needs: [prepare] uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" arch: "x86_64" image_tag: ${{ needs.prepare.outputs.linux_image_tag }} allow_stale_image: true recache: ${{ inputs.recache || false }} save_ccache: ${{ needs.prepare.outputs.save_linux_ccache == 'true' }} validate_fortran_fallback: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') }} build_packages: ${{ needs.prepare.outputs.build_linux_packages == 'true' }} secrets: inherit linux-sanitizers: name: Linux x86_64 ASan + UBSan needs: [prepare, linux] if: >- contains(github.event.pull_request.labels.*.name, 'full-ci') || contains(github.event.pull_request.labels.*.name, 'sanitizers') uses: ./.github/workflows/build-linux-sanitizers.yml with: hamlib_branch: "4.7.2" sanitizer: asan-ubsan image_tag: ${{ needs.prepare.outputs.linux_image_tag }} allow_stale_image: true recache: ${{ inputs.recache || false }} advisory: true linux-tsan: name: Linux x86_64 TSan needs: [prepare, linux] if: contains(github.event.pull_request.labels.*.name, 'thread-sanitizer') uses: ./.github/workflows/build-linux-sanitizers.yml with: hamlib_branch: "4.7.2" sanitizer: tsan recache: ${{ inputs.recache || false }} advisory: true linux-arm: needs: [prepare, linux] # Opt-in only -- see the two-tier note above. if: >- github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" arch: "aarch64" image_tag: ${{ needs.prepare.outputs.linux_image_tag }} allow_stale_image: true recache: ${{ inputs.recache || false }} save_ccache: ${{ needs.prepare.outputs.save_linux_ccache == 'true' }} build_packages: ${{ needs.prepare.outputs.build_linux_packages == 'true' }} secrets: inherit linux-armhf: needs: [prepare, linux] # Opt-in only, like the other targets beyond Linux x86_64. if: >- github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" arch: "armhf" image_tag: ${{ needs.prepare.outputs.armhf_image_tag }} allow_stale_image: true recache: ${{ inputs.recache || false }} save_ccache: ${{ needs.prepare.outputs.save_linux_ccache == 'true' }} build_packages: ${{ needs.prepare.outputs.build_linux_packages == 'true' }} secrets: inherit windows: needs: [prepare, linux] # Opt-in only -- see the two-tier note above. if: >- github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-windows.yml with: version: ${{ needs.prepare.outputs.version }} hamlib_branch: "4.7.2" recache: ${{ inputs.recache || false }}