|
| 1 | +# yamllint disable rule:line-length |
| 2 | + |
| 3 | +name: Arch e2e |
| 4 | + |
| 5 | +# These are SLOW end-to-end legs (QEMU emulation + an Intel macOS runner), so they |
| 6 | +# are kept OFF the per-PR path. They run on push-to-main, manual dispatch, and a |
| 7 | +# weekly cron only. Every install here is binary-only (VFOX_NIM_INSTALL_METHOD=binary |
| 8 | +# + nim@ref:devel prebuilt nightlies) so nothing compiles from source under emulation |
| 9 | +# or on the extra runner. |
| 10 | + |
| 11 | +# yamllint disable rule:truthy |
| 12 | +on: |
| 13 | + # yamllint enable rule:truthy |
| 14 | + workflow_dispatch: {} |
| 15 | + push: |
| 16 | + branches: [main] |
| 17 | + paths: |
| 18 | + - hooks/** |
| 19 | + - metadata.lua |
| 20 | + - .github/workflows/arch-e2e.yml |
| 21 | + schedule: |
| 22 | + # Weekly, Monday 06:00 UTC. |
| 23 | + - cron: "0 6 * * 1" |
| 24 | + |
| 25 | +permissions: |
| 26 | + contents: read |
| 27 | + |
| 28 | +jobs: |
| 29 | + # Emulated Linux aarch64 + armv7 via QEMU (uraimo/run-on-arch-action). Exercises |
| 30 | + # the GOARCH arm/arm64 values and the normalize_arch fix against real prebuilt |
| 31 | + # binaries through vfox. Binary-only: ref:devel resolves to the generic nightly |
| 32 | + # binaries (aarch64 -> linux_arm64.tar.xz, armv7 -> linux_armv7l.tar.xz) and |
| 33 | + # VFOX_NIM_INSTALL_METHOD=binary turns a missing binary into a hard error rather |
| 34 | + # than a source compile. |
| 35 | + linux_multiarch_e2e: |
| 36 | + name: Linux ${{ matrix.arch }} e2e |
| 37 | + runs-on: ubuntu-latest |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + include: |
| 42 | + - arch: aarch64 |
| 43 | + distro: ubuntu22.04 |
| 44 | + vfox_asset: vfox_1.0.11_linux_aarch64.tar.gz |
| 45 | + - arch: armv7 |
| 46 | + distro: ubuntu22.04 |
| 47 | + vfox_asset: vfox_1.0.11_linux_armv7.tar.gz |
| 48 | + steps: |
| 49 | + - name: Checkout plugin |
| 50 | + uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + fetch-depth: 0 |
| 53 | + |
| 54 | + - name: Binary-only Nim install under emulation |
| 55 | + uses: uraimo/run-on-arch-action@v2 |
| 56 | + with: |
| 57 | + arch: ${{ matrix.arch }} |
| 58 | + distro: ${{ matrix.distro }} |
| 59 | + githubToken: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + # Mount the checkout at a fixed path so the plugin source has a |
| 61 | + # deterministic location inside the container (independent of the |
| 62 | + # host workspace path). |
| 63 | + dockerRunArgs: | |
| 64 | + --volume "${{ github.workspace }}:/plugin" |
| 65 | + env: | |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + VFOX_NIM_INSTALL_METHOD: binary |
| 68 | + install: | |
| 69 | + apt-get update |
| 70 | + apt-get install -y curl xz-utils ca-certificates git |
| 71 | + run: | |
| 72 | + set -euo pipefail |
| 73 | +
|
| 74 | + # Install vfox from the release tarball for this arch. |
| 75 | + curl -fsSL -o /tmp/vfox.tar.gz \ |
| 76 | + "https://github.com/version-fox/vfox/releases/download/v1.0.11/${{ matrix.vfox_asset }}" |
| 77 | + tar -xzf /tmp/vfox.tar.gz -C /tmp |
| 78 | + mv "/tmp/vfox_1.0.11_linux_${{ matrix.arch }}/vfox" /usr/local/bin/vfox |
| 79 | + chmod +x /usr/local/bin/vfox |
| 80 | + vfox --version |
| 81 | +
|
| 82 | + # Sandbox vfox state under HOME (VFOX_HOME is vfox's documented home |
| 83 | + # override, the same var the integration spec sets). |
| 84 | + export VFOX_HOME="$HOME/.version-fox" |
| 85 | + mkdir -p "$VFOX_HOME" |
| 86 | +
|
| 87 | + # vfox add --source needs a .zip/.lua, not a directory. Build a zip of |
| 88 | + # the checkout exactly like the vfox integration spec does (git archive |
| 89 | + # of HEAD -> metadata.lua at the zip root), then add it. safe.directory |
| 90 | + # is needed because the mounted /plugin is owned by a different uid. |
| 91 | + git config --global --add safe.directory /plugin |
| 92 | + git -C /plugin archive --format=zip --output=/tmp/nim.zip HEAD |
| 93 | + vfox add --source /tmp/nim.zip --alias nim |
| 94 | +
|
| 95 | + # Binary-only install (ref:devel registers under the version name "devel"). |
| 96 | + vfox install -y nim@ref:devel |
| 97 | +
|
| 98 | + # `vfox use -g` does NOT take effect in a non-interactive shell (per the |
| 99 | + # vfox integration spec), so activate a project-local .tool-versions instead: |
| 100 | + # inside a dir declaring `nim devel`, `vfox activate` materializes the sdk |
| 101 | + # and prepends its bin to PATH. |
| 102 | + mkdir -p /tmp/proj |
| 103 | + printf 'nim devel\n' > /tmp/proj/.tool-versions |
| 104 | + cd /tmp/proj |
| 105 | + eval "$(vfox activate bash)" |
| 106 | + nim --version |
| 107 | +
|
| 108 | + # macOS x64 via mise. macos-13 (the last Intel image) is retired and |
| 109 | + # macos-latest is arm64, so macos-15-intel is the only hosted x64 macOS runner. |
| 110 | + # ref:devel resolves to the macosx_x64.tar.xz prebuilt nightly binary. |
| 111 | + macos_x64_e2e: |
| 112 | + name: macOS x64 e2e |
| 113 | + runs-on: macos-15-intel |
| 114 | + steps: |
| 115 | + - name: Checkout plugin |
| 116 | + uses: actions/checkout@v4 |
| 117 | + with: |
| 118 | + fetch-depth: 0 |
| 119 | + |
| 120 | + - name: Install mise |
| 121 | + uses: jdx/mise-action@v2 |
| 122 | + with: |
| 123 | + install: false |
| 124 | + |
| 125 | + - name: Binary-only Nim install on macOS x64 |
| 126 | + shell: bash |
| 127 | + env: |
| 128 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 129 | + MISE_YES: 1 |
| 130 | + VFOX_NIM_INSTALL_METHOD: binary |
| 131 | + run: | |
| 132 | + set -euo pipefail |
| 133 | +
|
| 134 | + # Register THIS checkout as the `nim` plugin, mirroring the mise |
| 135 | + # integration spec's local-plugin registration. |
| 136 | + mise plugin link --force nim "$GITHUB_WORKSPACE" |
| 137 | +
|
| 138 | + # Binary-only install + activate + run, mirroring the spec's |
| 139 | + # install / use / exec forms. |
| 140 | + mise install nim@ref:devel |
| 141 | + mise use -g nim@ref:devel |
| 142 | + mise exec nim@ref:devel -- nim --version |
0 commit comments