From: Andres Noetzli Date: Sat, 19 Jun 2021 04:07:10 +0000 (-0700) Subject: [CI] Build with all available cores (#6768) X-Git-Tag: cvc5-1.0.0~1587 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34c5774e511ebb2e5e9672cb7381797c3cd6264e;p=cvc5.git [CI] Build with all available cores (#6768) macOS virtual machines have three available cores but we were only using two of them for our CI. This commit changes the CI to retrieve the number of available cores and then to use that to number to build and test cvc5. --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95c6c035c..2a41efb59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,6 +82,7 @@ jobs: # # https://github.com/actions/runner/blob/master/docs/adrs/0278-env-context.md#dont-populate-the-env-context-with-environment-variables-from-runner-machine echo "image_version=$ImageVersion" >> $GITHUB_ENV + echo "num_proc=$(nproc)" >> $GITHUB_ENV echo "/usr/lib/ccache" >> $GITHUB_PATH # Note: macOS comes with a libedit; it does not need to brew-installed @@ -103,6 +104,7 @@ jobs: # # https://github.com/actions/runner/blob/master/docs/adrs/0278-env-context.md#dont-populate-the-env-context-with-environment-variables-from-runner-machine echo "image_version=$ImageVersion" >> $GITHUB_ENV + echo "num_proc=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - name: Install Python Dependencies @@ -191,14 +193,14 @@ jobs: --werror - name: Build - run: make -j2 + run: make -j${{ env.num_proc }} working-directory: build - name: ccache Statistics run: ccache -s - name: Run CTest - run: make -j2 check + run: make -j${{ env.num_proc }} check env: ARGS: --output-on-failure -LE regress[${{ matrix.exclude_regress }}] CVC5_REGRESSION_ARGS: --no-early-exit @@ -207,7 +209,7 @@ jobs: - name: Install Check run: | - make -j2 install + make -j${{ env.num_proc }} install echo -e "#include \nint main() { cvc5::api::Solver s; return 0; }" > /tmp/test.cpp g++ -std=c++11 /tmp/test.cpp -I install/include -L install/lib -lcvc5 working-directory: build @@ -225,14 +227,14 @@ jobs: mkdir build cd build cmake .. -DCMAKE_PREFIX_PATH=$(pwd)/../../build/install/lib/cmake - make -j2 - ctest -j2 --output-on-failure + make -j${{ env.num_proc }} + ctest -j${{ env.num_proc }} --output-on-failure working-directory: examples - name: Build Documentation if: matrix.build-documentation run: | - make -j2 docs-gh + make -j${{ env.num_proc }} docs-gh if [ "${{ github.event_name }}" == "pull_request" ] ; then echo "${{ github.event.number }}" > docs/sphinx-gh/prnum fi