Notcurses-Native.git | .github/workflows/ | _verify-linux-musl-aarch64.yml edit


# Reusable workflow: verify the linux-aarch64-musl prebuilt
# installs + loads on Alpine aarch64. Same shape as the x86_64
# musl lane — source-builds Rakudo inside the container via
# rakubrew on a `ubuntu-22.04-arm` host pulling the native aarch64
# alpine image.
#
# Rakudo source-build (~10-20 min on first run) is split from the
# test phase so a test failure doesn't bust the cache. See the
# x86_64 lane comment for the sequencing rationale.

name: _verify-linux-musl-aarch64

on:
  workflow_call:

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

jobs:
  verify:
    runs-on: ubuntu-22.04-arm
    steps:
      - uses: actions/checkout@v6
        with: { submodules: recursive }

      - name: Restore cached Rakudo (alpine aarch64)
        # Key has `-rakudo-only-v2` suffix to invalidate caches that
        # carried stale zef state. See the x86_64 musl lane for the
        # full root-cause writeup.
        id: rakubrew-cache
        uses: actions/cache/restore@v4
        with:
          path: _ci-cache/rakubrew-alpine-aarch64
          key: rakubrew-alpine-aarch64-${{ env.RAKUDO_VERSION }}-rakudo-only-v2

      - name: Pull alpine:3.20
        run: docker pull alpine:3.20

      - name: Build Rakudo in alpine:3.20 (cacheable phase)
        run: |
          mkdir -p _ci-cache/rakubrew-alpine-aarch64
          docker run --rm \
            -v "$PWD:/work" -w /work \
            -v "$PWD/_ci-cache/rakubrew-alpine-aarch64:/root/.rakubrew" \
            -e RAKUDO_VERSION="${{ env.RAKUDO_VERSION }}" \
            -e RAKUBREW_HOME=/root/.rakubrew \
            alpine:3.20 \
            sh -c 'apk add --no-cache bash >/dev/null && bash scripts/ci/prep-musl-rakudo.sh'

      - name: Fix cache permissions before save (docker ran as root)
        run: sudo chown -R "$(id -u):$(id -g)" _ci-cache/rakubrew-alpine-aarch64

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

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

      - name: Run tests in alpine:3.20 (flaky phase)
        run: |
          docker run --rm \
            -v "$PWD:/work" -w /work \
            -v "$PWD/_ci-cache/rakubrew-alpine-aarch64:/root/.rakubrew" \
            -e RAKUDO_VERSION="${{ env.RAKUDO_VERSION }}" \
            -e RAKUBREW_HOME=/root/.rakubrew \
            -e NOTCURSES_NATIVE_REQUIRE_SHIM \
            -e TERM=xterm \
            -e COLORTERM=truecolor \
            -e LANG=C.UTF-8 \
            -e LC_ALL=C.UTF-8 \
            alpine:3.20 \
            sh -c 'apk add --no-cache bash >/dev/null && bash scripts/ci/verify-musl-tests.sh'