| 1 |
name: 'set-make-job-count' |
| 2 |
description: 'Set the MAKE_JOB_COUNT environment variable to a value suitable for the host runner' |
| 3 |
runs: |
| 4 |
using: "composite" |
| 5 |
steps: |
| 6 |
|
| 7 |
|
| 8 |
- name: set-jobs-macOS |
| 9 |
if: runner.os == 'macOS' |
| 10 |
run: | |
| 11 |
echo MAKE_JOB_COUNT=$(expr $(printf '%s\n%s' $(( $(sysctl -n hw.memsize) * 4 / (1073741824 * 9) )) $(sysctl -n hw.logicalcpu) | sort -n | head -n1) '|' 1) >> $GITHUB_ENV |
| 12 |
shell: bash |
| 13 |
- name: set-jobs-windows |
| 14 |
if: runner.os == 'Windows' |
| 15 |
run: | |
| 16 |
echo MAKE_JOB_COUNT=$(expr $(printf '%s\n%s' $(( $(grep MemTotal: /proc/meminfo | cut -d: -f2 | cut -dk -f1) * 4 / (1048576 * 9) )) $(nproc) | sort -n | head -n1) '|' 1) >> $GITHUB_ENV |
| 17 |
shell: msys2 {0} |
| 18 |
- name: set-jobs-linux |
| 19 |
if: runner.os == 'Linux' |
| 20 |
run: | |
| 21 |
echo MAKE_JOB_COUNT=$(expr $(printf '%s\n%s' $(( $(grep MemTotal: /proc/meminfo | cut -d: -f2 | cut -dk -f1) * 4 / (1048576 * 9) )) $(nproc) | sort -n | head -n1) '|' 1) >> $GITHUB_ENV |
| 22 |
shell: bash |