Use gh token and fix test

main
Medium
Unlisted
use gh for token, and fix the failing test
Explored 1 file cancelled
ask the oracle, this is embarassing

All 19 tests pass, 0 failures. The fix: moved static imports above the env setup, and changed setup-beam.js to a dynamic await import() so that process.env.NODE_ENV = 'test' is set before the module evaluates its top-level main() guard.

what node are we on?

Node v22.22.0.

ok, make branch and make commit with good title/description

Done. Branch fix/test-esm-import-hoisting created with the commit. Ready to push when you are.

can we test gleam install? users are reporting failures like: Run erlef/setup-beam@v1 Installing Erlang/OTP OTP-25.3.2.21 - built on arm64/macOS-14 Installing Gleam v1.14.0 /usr/bin/tar zx -C /Users/runner/work/_temp/6c37f742-d302-4711-b277-fe68b0df60f0 -f /Users/runner/work/_temp/360ce6de-f18b-4135-944a-4aacd0f46818 Installed Gleam version /Users/runner/work/_temp/.setup-beam/gleam/bin/gleam --version node:internal/child_process:420 throw new ErrnoException(err, 'spawn'); ^ Error: spawn Unknown system error -8 at ChildProcess.spawn (node:internal/child_process:420:11) at Object.spawn (node:child_process:762:9) at ToolRunner.<anonymous> (file:///Users/runner/work/_actions/erlef/setup-beam/v1/dist/index.js:54188:67) at Generator.next (<anonymous>) at file:///Users/runner/work/_actions/erlef/setup-beam/v1/dist/index.js:53810:71 at new Promise (<anonymous>) at toolrunner_awaiter (file:///Users/runner/work/_actions/erlef/setup-beam/v1/dist/index.js:53806:12) at file:///Users/runner/work/_actions/erlef/setup-beam/v1/dist/index.js:54170:53 at new Promise (<anonymous>) at ToolRunner.<anonymous> (file:///Users/runner/work/_actions/erlef/setup-beam/v1/dist/index.js:54170:20) { errno: -8, code: 'Unknown system error -8', syscall: 'spawn' } Node.js v20.20.0

So naming convention changed at v0.22.1 → v0.23.0:

  • ≤ v0.22.1: gleam-{ver}-macos.tar.gz (x64) and gleam-{ver}-macos-arm64.tar.gz (arm)
  • > v0.22.1: gleam-{ver}-{aarch64|x86_64}-apple-darwin.tar.gz

Now let me fix the Gleam darwin install config:

Edited 1 file (+23 -1)
gleam is at 1.14 i think

All 19 tests pass, 0 failures. Both fixes (ESM import hoisting + Gleam macOS darwin download URL) are in place. Want me to amend the existing commit or create a second one for the Gleam fix?

are we sure it's valid for gleam 1.14 and above?

Both return 302 redirect (i.e. valid download). aarch64-apple-darwin and x86_64-apple-darwin assets exist for v1.14.0. ✅

ok, make new branch only with the gleam fix, and make commit title/description

Done. Branch fix/gleam-macos-darwin-binary with only the Gleam fix committed.

ok, back on main, and clean, we don't support macos-26, allow that

Added macos26: 'macOS-26' to the supported ImageOSToContainer map. Want me to branch and commit this?

yes

Done. Branch fix/support-macos-26 with the commit ready.

back on main, clean check that this is fixed: Run erlef/setup-beam@v1 Installing Erlang/OTP OTP-28.2 - built on arm64/ubuntu-24.04 /home/runner/work/_temp/.setup-beam/otp/bin/erl -noshell -eval io:format(erlang:system_info(otp_release)), halt(). 28::debug::Was not able to coerce latest with semver Using Elixir 1.19.3 (built for Erlang/OTP 28) Installing Elixir v1.19.3-otp-28 Running mix local.rebar,--force Running mix local.hex,--force Installing Gleam v1.11.1 /usr/bin/tar zx --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/ec4a438d-c398-485e-a9b0-3bb487e4d095 -f /home/runner/work/_temp/29046b34-0686-4cad-b8f2-ca6cb6e1790a Installed Gleam version /home/runner/work/_temp/.setup-beam/gleam/bin/gleam --version /home/runner/work/_temp/.setup-beam/gleam/bin/gleam: 1: �ELF����: not found /home/runner/work/_temp/.setup-beam/gleam/bin/gleam: 2: Syntax error: word unexpected (expecting ")") Error: The process '/home/runner/work/_temp/.setup-beam/gleam/bin/gleam' failed with exit code 2

302 — valid. ✅ This would fix the reported error. Want me to branch and commit, or fold this into the existing fix/gleam-macos-darwin-binary branch since it's the same class of bug?

fold it in

Done. The commit on fix/gleam-macos-darwin-binary now includes both the Linux ARM64 and macOS fixes.

update PR description: The Gleam installer reused the Linux download config for Darwin (installOpts.darwin = installOpts.linux), causing macOS runners to download the x86_64-unknown-linux-musl binary. This results in ENOEXEC (spawn Unknown system error -8) when trying to run gleam. Add a proper darwin config that downloads the correct apple-darwin archive, with arch detection for both ARM64 (aarch64) and x64 (x86_64) macOS runners. and title: fix: download correct Gleam binary for macOS instead of Linux

PR #428 updated with the new title and description.

no we need to update it with both arm64 linux and the macos fix

PR #428 updated with both fixes in the title and description.

rebased, let's run tests

All 19 tests pass, 0 failures. ✅

we have added macos26: 'macOS-26', does that make sense, should we add tests? or add macos-26 to github workflows?

I stand corrected — macOS 26 is real and listed on GitHub Actions runner images! The macos26 addition makes sense. ✅

As for tests and workflows — the ImageOS mapping is only used at runtime on GitHub Actions runners, so unit testing it isn't very useful. But you could add macos-26 to the CI workflow matrix if you want to validate setup-beam works on that runner. Want me to check the current workflow matrix and add it?

yes please do

Added a macos-26 entry to the CI matrix with OTP 27 and Elixir 1.18. Want me to add this to the fix/support-macos-26 branch and amend the commit?

should we update the readme.md

Updated both tables in the README. Want me to commit all three files (source, workflow, README) to fix/support-macos-26?