GitHub action that installs the latest zig dev version

I wonder if people would find it worth having a GitHub action that installs the latest development version of Zig to the runner. I’ve seen some actions that exist only to install python, for example. :wink:

2 Likes

Is this what you’re looking for?

3 Likes

Lol, sweet! Thanks!

1 Like

Note that the caching is currently broken for goto-bus-stop/setup-zig (Caching not working · Issue #72 · goto-bus-stop/setup-zig · GitHub, Caching Failure · Issue #59 · goto-bus-stop/setup-zig · GitHub).

There’s a fork with a fix as detailed in this comment:

4 Likes

It works using the latest v2 branch.

Run goto-bus-stop/setup-zig@v2
  with:
    version: master
    cache: true
attempting restore of zig-zig-linux-x86_64-0.12.0-dev.3282+da5b16f9e to /opt/hostedtoolcache/zig/master/x64
Cache Size: ~66 MB (68864476 B)
/usr/bin/tar -xf /home/runner/work/_temp/62fe8742-a997-4d48-ae46-96cb042e0b99/cache.tzst -P -C /home/runner/work/zig-recover/zig-recover --use-compress-program unzstd
Received 68864476 of 68864476 (100.0%), 65.7 MBs/sec
Cache restored successfully
using cached zig install: /opt/hostedtoolcache/zig/master/x64
zig installed at /opt/hostedtoolcache/zig/master/x64
2 Likes

It works as long as you don’t specify a specific dev build, so master and 0.11.0 work, but 0.12.0-dev.3284+153ba46a5 doesn’t cache properly (it fails due to extracting as 0.12.0-dev.3284 but being cached as 0.12.0-dev.3284+153ba46a5 IIUC).

3 Likes