We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c28f209 commit f59763eCopy full SHA for f59763e
.github/workflows/haskell-ci.yaml
@@ -24,6 +24,19 @@ jobs:
24
- name: Checkout the repository
25
uses: actions/checkout@v2
26
27
+ - name: Retrieve core count
28
+ id: cpuinfo
29
+ run: |
30
+ if [[ "$OSTYPE" == "linux"* ]]; then
31
+ cpu_count=`lscpu | grep "^CPU(s):" | grep -o "[0-9]*$"`
32
+ elif [[ "$OSTYPE" == "darwin"* ]]; then
33
+ cpu_count=`system_profiler SPHardwareDataType | grep "Cores" | grep -o "[0-9]*$"`
34
+ else
35
+ cpu_count=1
36
+ fi
37
+ echo "Detected ${cpu_count} (logical) cores."
38
+ echo "::set-output name=cpu_count::$cpu_count"
39
+
40
- name: Setup Haskell Stack
41
uses: actions/setup-haskell@v1
42
with:
@@ -69,4 +82,4 @@ jobs:
69
82
run: make build
70
83
71
84
- name: Run tests
72
- run: make tests
85
+ run: make tests -j${{ steps.cpuinfo.outputs.cpu_count }}
0 commit comments