Skip to content

Commit 618ac8d

Browse files
committed
Build and test in parallel in CI
Build and test in parallel with as many jobs as we have been allocated CPU cores. This should make CI runs faster and provide visibility to parallel build problems.
1 parent 2992af7 commit 618ac8d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,28 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- name: install packages
20+
id: info
2021
run: |
2122
case $RUNNER_OS in
2223
Linux)
2324
sudo apt-get install autoconf autoconf-archive automake flex libpcre2-dev libtool
25+
cpus=$(nproc)
2426
;;
2527
macOS)
2628
brew install autoconf autoconf-archive automake pcre2 libtool
29+
cpus=$(sysctl -n hw.activecpu)
2730
;;
31+
*)
32+
cpus=1
2833
esac
34+
echo "cpus=$cpus" >> "$GITHUB_OUTPUT"
2935
- name: autogen
3036
run: ./autogen.sh --no-configure
3137
- name: configure
3238
run: ./configure --disable-silent-rules
3339
- name: make
34-
run: make
40+
run: make -j${{ steps.info.outputs.cpus }}
3541
- name: make check
36-
run: make check
42+
run: make check -j${{ steps.info.outputs.cpus }}
3743
- name: make distcheck
38-
run: make distcheck
44+
run: make distcheck -j${{ steps.info.outputs.cpus }}

0 commit comments

Comments
 (0)