Skip to content

Commit

Permalink
CI: display number of cores, physical memory, and partition size (#2353)
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko committed Jun 14, 2024
1 parent 7fd777c commit 3b5a56f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,24 @@ jobs:
case '${{ runner.os }}' in
'Linux')
ncpu=$(nproc)
echo "Number of cores: ${ncpu}"
echo "$(grep MemTotal /proc/meminfo)"
echo -e "Partition sizes:\n$(df -k -h .)"
;;
'macOS')
ncpu=$(sysctl -n hw.ncpu)
hwmemsize=$(sysctl -n hw.memsize)
ramsize=$(expr $hwmemsize / $((1024**3)))
echo "Number of cores: ${ncpu}"
echo "Physical memory: ${ramsize} GB"
echo -e "Partition sizes:\n$(df -k -h .)"
;;
'Windows')
ncpu=${NUMBER_OF_PROCESSORS}
CD=${PWD:1:1}
echo "Number of cores: ${NUMBER_OF_PROCESSORS}"
echo "Physical memory: $(wmic ComputerSystem get TotalPhysicalMemory)"
echo -e "Partition sizes:\n$(wmic logicaldisk get name,size,freespace | grep -e "${CD^}" -e "FreeSpace")"
;;
esac
[[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
Expand Down

0 comments on commit 3b5a56f

Please sign in to comment.