Skip to content

Commit cd55a5f

Browse files
committed
Fixup action
Tweak action with same shell settings and conditions as other steps. * Add print debugging of GOMEMLIMIT env var. Signed-off-by: SuperQ <[email protected]>
1 parent 1074bbd commit cd55a5f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

actions/setup_environment/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,20 @@ runs:
3737
restore-keys: |
3838
${{ runner.os }}-npm-
3939
- name: Set GOMEMLIMIT
40+
shell: bash
4041
run: |
41-
ratio="${{ inputs.memlimit_ratio }}"
42-
# Get the memory limit from cgroups v2.
42+
ratio=${{ inputs.memlimit_ratio }}
4343
cgroup=$(awk -F':' '{print $3}' /proc/self/cgroup)
4444
cgroup_mem_limit=$(< "/sys/fs/cgroup/${cgroup}/memory.max")
4545
if [[ "${cgroup_mem_limit}" != "max" ]] ; then
4646
echo "${cgroup_mem_limit}" | awk -v "ratio=${ratio}" '{printf "GOMEMLIMIT=%.0fKiB\n", $1 / 1024 * ratio}' >> "$GITHUB_ENV"
4747
exit 0
4848
fi
49-
# Fallback to the system memory limit.
5049
awk -v "ratio=${ratio}" '$1 == "MemTotal:" {printf "GOMEMLIMIT=%.0fKiB\n", $2 * ratio}' /proc/meminfo >> "$GITHUB_ENV"
50+
if: inputs.enable_go == 'true'
51+
- run: echo "GOMEMLIMIT=${GOMEMLIMIT}"
52+
shell: bash
53+
if: inputs.enable_go == 'true'
5154
- run: make promu
5255
shell: bash
5356
if: inputs.enable_go == 'true'

0 commit comments

Comments
 (0)