Live data from Hacker News

Act: Run your GitHub Actions locally

github.com

151–160 of 161 posts

Re: Act: Run your GitHub Actions locally

#151

Earlier quoted context omitted.

>With actions you can run multiple tasks in parallel, If you mean "I want to run one build with the foo feature and one build with the bar feature. Actions lets me run those in parallel", then that is the "strategy" part of the workflow, not the "tasks" part. My comment was about the latter. ("and make your GH Actions run `make` in a script task.") If you mean "I want to run two steps of a job in parallel and then ru…

> Running things in parallel is literally a single `&` character. Yes now try waiting for all parallel tasks, and error out if at least one errors. And try separating their output so that they don't get interleaved into a big mess. And try by default hiding the outputs of commands that succeeded, only showing those that failed, except when the user explicitly asks for it. Your "simple" shell script now suddenly isn't…

>Yes now try waiting for all parallel tasks,

`wait`

>and error out if at least one errors.

`wait` propagates the exit status of the waited task. `set -e` triggers the script to exit on any command failure.

>And try separating their output so that they don't get interleaved into a big mess.

`| while read -r line; do echo "task X: $line"; done`

Learn the tools instead of being so confident that it can't be done or that it's complicated.

Re: Act: Run your GitHub Actions locally

#152
post #133

It’d be great if act could build its container images locally instead of downloading them through a rate-limited pipe from docker hub. The full size image (~14gb) takes the better part of a day to download; I’ve never been able to wait it out on my work laptop.

You should try pulling it from gcr.io.

Re: Act: Run your GitHub Actions locally

#153

Earlier quoted context omitted.

It was indeed very unexpected. The first time you would try out a cli tool you’d expect just calling its name to return help info and maybe an error.

/sbin/reboot would surprise you. Use --help for help info.

    shutdown /?
oh no

Re: Act: Run your GitHub Actions locally

#155

Earlier quoted context omitted.

> Running things in parallel is literally a single `&` character. Yes now try waiting for all parallel tasks, and error out if at least one errors. And try separating their output so that they don't get interleaved into a big mess. And try by default hiding the outputs of commands that succeeded, only showing those that failed, except when the user explicitly asks for it. Your "simple" shell script now suddenly isn't…

>Yes now try waiting for all parallel tasks, `wait` >and error out if at least one errors. `wait` propagates the exit status of the waited task. `set -e` triggers the script to exit on any command failure. >And try separating their output so that they don't get interleaved into a big mess. `| while read -r line; do echo "task X: $line"; done` Learn the tools instead of being so confident that it can't be done or that…

You remind me of that guy who said there's no point in Dropbox because one can "just simply setup an sftp server".

Re: Act: Run your GitHub Actions locally

#156
post #55

Earlier quoted context omitted.

Same can be said about Nix and as a bonus you get Nix instead of Starlark

Nix & Make is the True Engineer(tm)'s Bazel.

Are Nix and Bazel mutually exclusive?

https://www.tweag.io/blog/2018-03-15-bazel-nix/

Re: Act: Run your GitHub Actions locally

#158
post #16

Earlier quoted context omitted.

I add a workflow like this: - write the main job in a Python/PowerShell/Bash script that runs locally, - write a workflow that sets up the environment (AWS login), installs dependencies (using GitHub's facilities for that) and calls the script (often passing values using GitHub Secrets), - push the workflow with a "push" trigger on a feature branch (for fast testing), - push 30 fixup commits to fix all the small synt…

> - push 30 fixup commits to fix all the small syntax errors, logic mistakes, and GHA idiosyncrasies I hadn't thought of, I don't have a lot of experience with GitHub Actions, but is there really no better way to do this?

[deleted]

Re: Act: Run your GitHub Actions locally

#159
I'm a strong advocate (after migration between various cloud CI providers free tiers when I worked in academia) of making your build process as agnostic as possible to the CI provider. That generally means putting things into shell scripts and calling them, which can be a bit painful, and you'll never get 100% there, but it also has the added benefit of being able to debug things locally too if something goes wrong with the pipeline.

The first time I used GH Actions I thought there was a strong vendor lock-in element to it which I wasn't hugely comfortable with. I'm a big fan of using GitLab CI these days which seems to be a good trade off between various considerations.

Re: Act: Run your GitHub Actions locally

#160

Earlier quoted context omitted.

Except that `git commit -n` exists. Server-side checking is still important.

The post is about running github actions locally though. The built in ones also support running server-side too, though I imagine github doesn't have the same level of interface over that as their own services.

The comment I was replying to seemed to have the idea that `git hooks` could replace actions. Maybe I just read too much into it.
Post reply on HN