Live data from Hacker News

Run GitHub Actions locally

github.com

11–20 of 137 posts

Re: Run GitHub Actions locally

#11
post #5

Just this week I tried giving this another chance to debug some weird CI failures for ruby tests. I’m on M-series macs so there is an inherent platform mismatch. That coupled with us using depot images as action runners. I was never able to get it running past the dry-run stage. There is just a lot of differences between CI runners and my local docker images. I even gave the image from catthehacker a try. Which is li…

It’s even worse than that, it’s 20GB compressed and 60GB uncompressed. Regardless, if your VM runs out of disk space there’s no meaningful error (well 12 months ago) except a failure to start. (Possibly colima-specific I dunno I uninstalled docker-docker)

I do find that some things just work locally and fail in real actions and vice versa. For the most part it’s made it easier to move the bar forward though.

Re: Run GitHub Actions locally

#12
post #2

I've wanted this so much! My main questions are about permissions. I use environment-specific variables and secrets, I would need to reconfigure them locally and didn't see how. The other issue is workload identity federation.

Secrets can be loaded from a file.

https://nektosact.com/usage/index.html?highlight=Secret#secr...

Re: Run GitHub Actions locally

#13
post #4

Lots of changes have to be made to your github action workflow to actually make this work properly.

What things have you needed to change? Can't say I've ever needed to do that but of course I've only used it on a few projects.

In GitHub we use an OIDC token to access some AWS resources. Locally I need to populate tokens etc and so I have an `if: ${{ACT}}` and a not condition to populate it.

Re: Run GitHub Actions locally

#14
post #5

Just this week I tried giving this another chance to debug some weird CI failures for ruby tests. I’m on M-series macs so there is an inherent platform mismatch. That coupled with us using depot images as action runners. I was never able to get it running past the dry-run stage. There is just a lot of differences between CI runners and my local docker images. I even gave the image from catthehacker a try. Which is li…

Something like this may help by letting you ssh into the running instance so you can debug with the exact context: https://docs.warpbuild.com/tools/action-debugger

Re: Run GitHub Actions locally

#15
Last time I looked at it, Act was a lot like the “serverless offline” options out there that try to mimic AWS services. If your use case is straightforward then I might work but if you do anything “exotic” (often the types of things I’m trying to debug in a failed run) Act doesn’t fully replicate the GHA experience.

Also, understandably, there is no macOS support and I use macOS on GHA for iOS builds (another place I have to debug that this wouldn’t cover).

Re: Run GitHub Actions locally

#16
It's important to note that this tool does not use the same container images or runtime environment that GitHub Actions actually runs. It's an approximation.

For simple use cases that won't matter, but if you have complex GitHub Actions you're bound to find varying behavior. That can lead to frustration when you're debugging bizarre CI failures.

Re: Run GitHub Actions locally

#20
post #5

Just this week I tried giving this another chance to debug some weird CI failures for ruby tests. I’m on M-series macs so there is an inherent platform mismatch. That coupled with us using depot images as action runners. I was never able to get it running past the dry-run stage. There is just a lot of differences between CI runners and my local docker images. I even gave the image from catthehacker a try. Which is li…

I had luck with my actions I tried to debug. But I also had the issue that the runtime difference is simply too big to 100% trust it. Too bad because I think the tool is quite good.
Post reply on HN