From 024741b4763daa2e5fa6a5724229b3335835b9ef Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Thu, 3 Jun 2021 08:00:00 +0300 Subject: [PATCH] CI: set up multi-thread build for all platforms --- .github/workflows/linux.yml | 4 +++- .github/workflows/macos.yml | 4 +++- .github/workflows/windows.yml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0f0d7bf5..4dcd3b3c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -67,7 +67,9 @@ jobs: - name: Build working-directory: ${{runner.workspace}}/build - run: cmake --build . --config ${{matrix.build_type}} + run: | + threads=`nproc` + cmake --build . --config ${{matrix.build_type}} --parallel $threads - name: Test working-directory: ${{runner.workspace}}/build diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f62dbdc6..e300a22b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -26,7 +26,9 @@ jobs: - name: Build working-directory: ${{runner.workspace}}/build - run: cmake --build . --config ${{matrix.build_type}} + run: | + threads=`sysctl -n hw.logicalcpu` + cmake --build . --config ${{matrix.build_type}} --parallel $threads - name: Test working-directory: ${{runner.workspace}}/build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f1d11c8f..ece0372b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -49,7 +49,9 @@ jobs: - name: Build working-directory: ${{runner.workspace}}/build - run: cmake --build . --config ${{matrix.build_type}} + run: | + $threads = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors + cmake --build . --config ${{matrix.build_type}} --parallel $threads - name: Test working-directory: ${{runner.workspace}}/build