Skip to content

Commit

Permalink
Use multiple threads for running tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
apaszke committed Nov 22, 2021
1 parent c28f209 commit f59763e
Showing 1 changed file with 14 additions and 1 deletion.
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 }}

0 comments on commit f59763e

Please sign in to comment.