Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/haskell-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Retrieve core count
id: cpuinfo
run: |
if [[ "$OSTYPE" == "linux"* ]]; then
cpu_count=`lscpu | grep "^CPU(s):" | grep -o "[0-9]*$"`
elif [[ "$OSTYPE" == "darwin"* ]]; then
cpu_count=`system_profiler SPHardwareDataType | grep "Cores" | grep -o "[0-9]*$"`
else
cpu_count=1
fi
echo "Detected ${cpu_count} (logical) cores."
echo "::set-output name=cpu_count::$cpu_count"

- name: Setup Haskell Stack
uses: actions/setup-haskell@v1
with:
Expand Down Expand Up @@ -69,4 +82,4 @@ jobs:
run: make build

- name: Run tests
run: make tests
run: make tests -j${{ steps.cpuinfo.outputs.cpu_count }}