News for hackers. Stuff that matters.
Re:Any program can be a GitHub Actions shell by cdata on Tuesday April 08, 2025 @01:45AM (#43618667)
I wonder if you could pair this with nix e.g.,:

    - shell: nix develop --command {0}
      run: ...
Re:Any program can be a GitHub Actions shell by asmor on Tuesday April 08, 2025 @02:06AM (#43618779)
In my experience, the default VM size is so slow, you probably don't want Nix on a workflow that doesn't already take minutes.

Even with a binary cache (we used R2), installing Lix, Devbox and some common tools costs us 2 1/2 minutes. Just evaluating the derivation takes ~20-30 seconds.

Re:Any program can be a GitHub Actions shell by manx on Tuesday April 08, 2025 @04:52AM (#43619623)
Is there a way to cache the derivation evaluation?
Re:Any program can be a GitHub Actions shell by chuckadams on Tuesday April 08, 2025 @08:30AM (#43620949)
You can cache arbitrary directories in github actions, but the nix package cache is enormous and probably bigger than GH's cache system will allow. Restoring multi-gig caches is also not instant, though it still beats doing everything from scratch. Might be more feasible to bake the cache into a container image instead. I think any nix enthusiast is still likely to go for self-hosted runners though.
Re:Any program can be a GitHub Actions shell by asmor on Tuesday April 08, 2025 @02:50PM (#43625253)
The default cache action also has issued with anything that isn't owned by the runner user, and caches are per-repository, so you can't just have one cache like you do for binary caches.
Re:Any program can be a GitHub Actions shell by adobrawy on Tuesday April 08, 2025 @06:48AM (#43620210)
You can use a self-hosted runner with an image that has anything pre-loaded.
Re:Any program can be a GitHub Actions shell by tadfisher on Tuesday April 08, 2025 @12:54PM (#43623866)
Yes, we do this, although you need to do `nix develop --command bash -- {0}` to make it behave as a shell.