Re:Act: Run your GitHub Actions locally
by cormacrelf on Saturday November 26, 2022 @09:41AM
(#33753012)
That’s what GNU Parallel is for. Or Pueue, which gives you a GH-Actions-level feature set but it’s less likely to be installed on any particular machine. Pretty sure you could fetch a pueue binary at the start of an actions script and do everything that way.
Re:Act: Run your GitHub Actions locally
by stabbles on Saturday November 26, 2022 @09:36AM
(#33752977)
Using GNU make you can get very nice output sync:
all: variant-1 variant-2
@echo done with all
variant-%:
@echo starting $@
@sleep 1
@echo done $@
Use `make -j2 --output-sync=target`.
Re:Act: Run your GitHub Actions locally
by notpushkin on Saturday November 26, 2022 @10:24AM
(#33753370)
brew install make
gmake -j2 --output-sync=target
on macOS.
Re:Act: Run your GitHub Actions locally
by Arnavion on Saturday November 26, 2022 @07:48PM
(#33758778)
>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
by FooBarWidget on Sunday November 27, 2022 @12:48PM
(#33764873)
You remind me of that guy who said there's no point in Dropbox because one can "just simply setup an sftp server".
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 so simple anymore.