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


# Reusable workflow: verify the linux-aarch64-glibc prebuilt
# installs + loads on aarch64.
#
# Raku/setup-raku@v1 has no aarch64 Linux prebuilt, so we
# source-build Rakudo via rakubrew. First run is ~10-20 min;
# subsequent runs hit actions/cache and skip.

name: _verify-linux-glibc-aarch64

on:
  workflow_call:

env:
  TERM: xterm
  COLORTERM: truecolor
  LANG: en_US.UTF-8
  LC_ALL: en_US.UTF-8
  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: Install Rakudo build deps
        run: |
          sudo apt-get update -qq
          sudo apt-get install -y --no-install-recommends \
            build-essential perl curl git ca-certificates

      - 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.
        # save runs immediately after a successful build, before the
        # zef install / prove6 / xt steps that can fail independently.
        #
        # Cache key has a `-rakudo-only-v2` suffix to invalidate any
        # pre-v2 caches that included stale zef module state under
        # `versions/moar-*/install/share/perl6/site/`. Those caused
        # `zef install` to short-circuit ("All candidates are
        # currently installed") on a hit, which skipped
        # Build.rakumod and left `~/.local/share/Notcurses-Native/`
        # unstaged → dlopen failed at test time.
        id: rakudo-cache
        uses: actions/cache/restore@v4
        with:
          path: ~/.rakubrew
          key: rakudo-linux-aarch64-${{ env.RAKUDO_VERSION }}-rakudo-only-v2

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

      - name: Strip zef module state — we cache Rakudo only, not installs
        # Belt-and-braces against a dirty restored cache: even with the
        # bumped key, any future tweak that accidentally captures
        # site/ should still produce a clean test environment.
        # `Notcurses::Native` and `App::Prove6` get reinstalled fresh
        # in the next steps (exercising Build.rakumod + the bundle
        # download), which is what we want to verify.
        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-linux-aarch64-${{ 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
        # Two dirs:
        #   1. shims/ — rakubrew's dispatch wrappers for raku/zef
        #      (created by `rakubrew build` + `rehash`).
        #   2. install/share/perl6/site/bin — where `zef install`
        #      puts module-provided binaries (App::Prove6's
        #      `prove6` lands here). rakubrew doesn't auto-rehash
        #      after each `zef install`, so binaries installed
        #      via zef after the build aren't shimmed unless we
        #      explicitly run `rakubrew rehash` (which we'd need
        #      to do after every zef install). Adding the site-bin
        #      dir directly to PATH avoids that maintenance burden
        #      and matches how setup-raku configures PATH for
        #      lanes that don't use rakubrew.
        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 App::Prove6
        run: zef install --/test App::Prove6

      - name: prove6 (prebuilt path)
        run: prove6 --verbose -I lib -I t/lib t

      - name: prove (xt — terminal-dependent, prebuilt path)
        run: prove -e 'raku -I lib -I t/lib' --verbose xt/*.rakutest

      - name: Install apt deps for source-build pass
        run: |
          sudo apt-get install -y --no-install-recommends \
            cmake pkg-config \
            libncurses-dev libunistring-dev libdeflate-dev \
            libavformat-dev libavcodec-dev libavdevice-dev \
            libavutil-dev libswscale-dev

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

      - name: prove6 (source-build path)
        run: prove6 --verbose -I lib -I t/lib t