Live data from Hacker News

Run GitHub Actions locally

github.com

51–60 of 137 posts

Re: Run GitHub Actions locally

#51
Rather than tying CI & deployments to Github Actions, it is usually better to pull as much of it as possible out to shell scripts and call them in containers in GH actions..

There are optimizations you’ll want (caching downloaded dependencies etc); if you wait to make those after your build is CI-agnostic you’ll be less tempted by vendor specific shortcuts.

Usually means more code - but, easier to test locally. Also, swapping providers later will be difficult but not “spin up a team and spend 6 months” level.

Re: Run GitHub Actions locally

#52
post #23

I think this is really cool. We're tackling this problem from the other side by building `pixi` (pixi.sh) which bundles project / package management with a task runner so that any CI should be as simple as `pixi run test` and easy to execute locally or in the cloud.

that’s not really what’s new or special about pixi, is it? poetry (poethepoet) and uv can both do variations of this.

From the outside, pixi looks like a way to replace (conda + pip) with (not-conda + uv). It’s like uv-for-conda, but also uses uv internally.

Better task running is cool, but it would be odd to use pixi if you don’t otherwise need conda stuff. And extra super duper weird if you don’t have any python code!

Re: Run GitHub Actions locally

#53

Rather than tying CI & deployments to Github Actions, it is usually better to pull as much of it as possible out to shell scripts and call them in containers in GH actions.. There are optimizations you’ll want (caching downloaded dependencies etc); if you wait to make those after your build is CI-agnostic you’ll be less tempted by vendor specific shortcuts. Usually means more code - but, easier to test locally. Also,…

Nix is in fact perfect for this.

Re: Run GitHub Actions locally

#54

Rather than tying CI & deployments to Github Actions, it is usually better to pull as much of it as possible out to shell scripts and call them in containers in GH actions.. There are optimizations you’ll want (caching downloaded dependencies etc); if you wait to make those after your build is CI-agnostic you’ll be less tempted by vendor specific shortcuts. Usually means more code - but, easier to test locally. Also,…

This is always the top comment in these kinds of threads, and I see this as an indication that the current state of CI/CD is pathetically propriety.

It’s like the dark times before free and open source compilers.

When are we going to push back and say enough is enough!?

CI/CD desperately needs something akin to Kubernetes to claw back our control and ability to work locally.

Personally, I’m fed up with pipeline development inner loops that involve a Git commit, push, and waiting around for five minutes with no debugger, no variable inspector, and dumping things to console logs like I’m writing C in the 1980s.

You and I shouldn’t be reinventing these wheels while standing inside the tyre shop.

Re: Run GitHub Actions locally

#55
post #47

Dumb question, but why hasn’t GitHub made a solution that lets you run GitHub Actions locally? Or at the very least a solution that validates the action (giving a bit more certainty that it will succeed, a bit like a dry-run)? (My war story:) I stopped using GHAs after an optimistic attempt to save myself five key strokes ‘r’ ‘s’ ‘p’ ‘e’ ‘c’ led to 40+ commits and seeing the sunrise but still no successful test run v…

They do.

Your action can be empty and actions generate webhook events.

Do whatever you want with the webhook.

Re: Run GitHub Actions locally

#56
post #53

Rather than tying CI & deployments to Github Actions, it is usually better to pull as much of it as possible out to shell scripts and call them in containers in GH actions.. There are optimizations you’ll want (caching downloaded dependencies etc); if you wait to make those after your build is CI-agnostic you’ll be less tempted by vendor specific shortcuts. Usually means more code - but, easier to test locally. Also,…

Nix is in fact perfect for this.

As a non-Nix user, could you give me an example?

Re: Run GitHub Actions locally

#57
If CI/CD tools were code editors, then Jenkins/JFrog would be like Vi/Vim—powerful and traditional. GitLab CI would resemble Helix or Zed, offering a modern and efficient approach. Meanwhile, GitHub Actions would be akin to VSCode, but with a touch of Dreamweaver CC, blending user-friendly features with comprehensive capabilities.

Re: Run GitHub Actions locally

#58
post #57

If CI/CD tools were code editors, then Jenkins/JFrog would be like Vi/Vim—powerful and traditional. GitLab CI would resemble Helix or Zed, offering a modern and efficient approach. Meanwhile, GitHub Actions would be akin to VSCode, but with a touch of Dreamweaver CC, blending user-friendly features with comprehensive capabilities.

Have you ever use any of those in a realistic scenario? Any existing CI/CD solution is broken like hell and if you try to do more advanced stuff like reusing templates or actions, all hell breaks lose. Don't get me started on clones via SSH, doing commits from pipelines, etc.

CI/CD is one of the topics that is barely solved or usable ...

Re: Run GitHub Actions locally

#59
post #56
post #53

Earlier quoted context omitted.

Nix is in fact perfect for this.

As a non-Nix user, could you give me an example?

While flakes have their own "checks" thing, what I do is just have a app definition in flake with the required dependencies.

https://github.com/Cloudef/zig-aio/blob/master/flake.nix#L25...

https://github.com/Cloudef/zig-budoux/blob/master/flake.nix#...

The actual GA workflow file is pretty simple: https://github.com/Cloudef/zig-aio/blob/master/.github/workf...

Re: Run GitHub Actions locally

#60
post #47

Dumb question, but why hasn’t GitHub made a solution that lets you run GitHub Actions locally? Or at the very least a solution that validates the action (giving a bit more certainty that it will succeed, a bit like a dry-run)? (My war story:) I stopped using GHAs after an optimistic attempt to save myself five key strokes ‘r’ ‘s’ ‘p’ ‘e’ ‘c’ led to 40+ commits and seeing the sunrise but still no successful test run v…

Like https://docs.gitlab.com/runner/ ?
Post reply on HN