diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5afadb86..2460cc32 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -34,6 +34,8 @@ jobs: - name: Build-Library if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} run: | + # Get number of CPU cores + CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1) echo "Building SpiderMonkey" #install rust compiler curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y @@ -48,14 +50,14 @@ jobs: mkdir _build cd _build ../configure --disable-jemalloc --with-system-zlib --with-intl-api --enable-optimize - make + make -j$CPUS sudo make install cd ../../../.. echo "Building the library" mkdir build cd build cmake .. - cmake --build . + cmake --build . -j$CPUS echo "Build complete" - name: google-tests run: | diff --git a/build_script.sh b/build_script.sh index 3c0c5a43..e985294e 100755 --- a/build_script.sh +++ b/build_script.sh @@ -1,3 +1,6 @@ +# Get number of CPU cores +CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1) + DIR="build" if [ ! -d "$DIR" ]; then ### Take action if $DIR exists ### @@ -6,4 +9,4 @@ fi cd build cmake .. -cmake --build . \ No newline at end of file +cmake --build . -j$CPUS \ No newline at end of file diff --git a/setup.sh b/setup.sh index 43315e43..601042bd 100755 --- a/setup.sh +++ b/setup.sh @@ -1,3 +1,6 @@ +# Get number of CPU cores +CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1) + apt-get update --yes apt-get upgrade --yes apt-get install cmake python3-dev python3-pytest doxygen graphviz gcovr llvm g++ pkg-config m4 --yes @@ -13,5 +16,5 @@ chmod +x ./configure mkdir _build cd _build ../configure --disable-jemalloc --with-system-zlib --with-intl-api --enable-optimize -make +make -j$CPUS make install \ No newline at end of file