From 71141c5c490a4d86d273b08edadf557f4d20e2a1 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 0f0d7bf50e86..4dcd3b3c2f60 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 f62dbdc66a79..e300a22bd33c 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 f1d11c8fb016..ece0372bc58b 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