Notcurses-Native.git | .github/workflows/ | _verify-windows-arm64.yml edit


# Reusable workflow: verify the windows-arm64 prebuilt installs +
# loads on Windows ARM. Raku/setup-raku@v1 has no Windows ARM64
# prebuilt, so we source-build Rakudo via rakubrew inside MSYS2
# CLANGARM64 — the same MSYS2 environment we use to build the
# prebuilt. Build takes ~10-20 min on first run; cached after.
#
# Upstream notcurses-tester is broken on Windows so we don't run
# prove6 — successful zef install is what verifies the bundle.

name: _verify-windows-arm64

on:
  workflow_call:

env:
  NOTCURSES_NATIVE_REQUIRE_SHIM: '1'
  RAKUDO_VERSION: '2026.03'

jobs:
  verify:
    runs-on: windows-11-arm
    defaults:
      run:
        shell: 'msys2 {0}'
    steps:
      - uses: actions/checkout@v6
        with: { submodules: recursive }

      - uses: msys2/setup-msys2@v2
        with:
          msystem: CLANGARM64
          update: true
          path-type: inherit
          install: >-
            base-devel
            perl
            curl
            git
            mingw-w64-clang-aarch64-cmake
            mingw-w64-clang-aarch64-ffmpeg
            mingw-w64-clang-aarch64-libdeflate
            mingw-w64-clang-aarch64-libunistring
            mingw-w64-clang-aarch64-ncurses
            mingw-w64-clang-aarch64-ninja
            mingw-w64-clang-aarch64-toolchain

      - name: Restore source-built Rakudo
        # restore + save split (not actions/cache@v4) so a downstream
        # test failure doesn't invalidate the ~10-20 min Rakudo build.
        # Key has `-rakudo-only-v2` suffix to invalidate caches that
        # carried stale zef state in site/ — see the linux-aarch64
        # lane for the full root-cause writeup.
        id: rakudo-cache
        uses: actions/cache/restore@v4
        with:
          # MSYS2 maps $HOME to a Windows path; rakubrew installs
          # there. Path is captured by cache.
          path: ~/.rakubrew
          key: rakudo-windows-arm64-${{ env.RAKUDO_VERSION }}-rakudo-only-v2

      - name: Build ARM64 Rakudo from source (rakubrew)
        run: bash scripts/ci/build-rakudo.sh

      - name: Strip zef module state — we cache Rakudo only, not installs
        run: rm -rf ~/.rakubrew/versions/moar-*/install/share/perl6/site || true

      - name: Save Rakudo cache (build succeeded — independent of tests)
        if: steps.rakudo-cache.outputs.cache-hit != 'true'
        uses: actions/cache/save@v4
        with:
          path: ~/.rakubrew
          key: rakudo-windows-arm64-${{ env.RAKUDO_VERSION }}-rakudo-only-v2

      - name: Install zef (~30s; not cached on purpose — see script header)
        run: bash scripts/ci/install-zef.sh

      - name: Add Rakudo shims + site-bin to PATH
        # shims/ for raku/zef (rakubrew-managed). site-bin for
        # zef-installed module bins like prove6.
        run: |
          echo "$HOME/.rakubrew/shims" >> "$GITHUB_PATH"
          echo "$HOME/.rakubrew/versions/moar-${{ env.RAKUDO_VERSION }}/install/share/perl6/site/bin" >> "$GITHUB_PATH"

      - name: zef install (prebuilt path)
        run: zef install --/test .

      - name: zef install (source-build path)
        env: { NOTCURSES_NATIVE_BUILD_FROM_SOURCE: '1' }
        run: zef install --/test --force-install .