From 618ac8d468ebc5be1d2755c7479a89a8f77a9bde Mon Sep 17 00:00:00 2001 From: Ryan Carsten Schmidt Date: Tue, 23 Apr 2024 18:21:07 -0500 Subject: [PATCH] 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. --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9b025853..55d154725 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,22 +17,28 @@ jobs: steps: - uses: actions/checkout@v4 - name: install packages + id: info run: | case $RUNNER_OS in Linux) sudo apt-get install autoconf autoconf-archive automake flex libpcre2-dev libtool + cpus=$(nproc) ;; macOS) brew install autoconf autoconf-archive automake pcre2 libtool + cpus=$(sysctl -n hw.activecpu) ;; + *) + cpus=1 esac + echo "cpus=$cpus" >> "$GITHUB_OUTPUT" - name: autogen run: ./autogen.sh --no-configure - name: configure run: ./configure --disable-silent-rules - name: make - run: make + run: make -j${{ steps.info.outputs.cpus }} - name: make check - run: make check + run: make check -j${{ steps.info.outputs.cpus }} - name: make distcheck - run: make distcheck + run: make distcheck -j${{ steps.info.outputs.cpus }}