github-actions-cpu-cores
github-actions-cpu-cores copied to clipboard
Why not just nproc?
$ nproc --help
Usage: nproc [OPTION]...
Print the number of processing units available to the current process,
which may be less than the number of online processors
Works perfectly fine in a simple shell step.
- name: Get core count
id: nproc
run: echo "cores=$(nproc --all)" >> $GITHUB_OUTPUT
- name: Using nproc directly
run: terraform plan -parallelism=$(nproc --all)
Why would I use your action instead? I don't see the benefit, but am curious for your use case. I mean this only works on Linux and macOS and a js based action would also run on Windows. On the other hand the js based action is like 3000 lines of code and a js engine needs to start up. ;)
I do need it to work on Windows
Wanna send a PR to the readme stating that this module isn't needed for systems with a functioning nproc?