Skip to content

Commit 151fd58

Browse files
committed
Use parallel builds for Github Actions
Standard GitHub-hosted runners for public repositories have 4 CPUs, with the exception of MacOS(M1) which has 3. For now, simply assume that -j 4 is suitable for all cases. See https://docs.github.com/en/actions/reference/runners/github-hosted-runners
1 parent 66a8dcf commit 151fd58

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

.github/workflows/fedora-build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug"
4545

4646
- name: Build
47-
run: cmake --build build
47+
run: cmake --build build -j 4
4848

4949
- name: Test
50-
run: ctest --test-dir build --output-on-failure
50+
run: ctest --test-dir build --output-on-failure -j 4
5151

5252
build-fedora-release:
5353
strategy:
@@ -87,10 +87,10 @@ jobs:
8787
run: cmake -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=YES -DBUILD_DOCS=YES -DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE
8888

8989
- name: Build
90-
run: cmake --build build
90+
run: cmake --build build -j 4
9191

9292
- name: Test
93-
run: ctest --test-dir build --output-on-failure
93+
run: ctest --test-dir build --output-on-failure -j 4
9494

9595
- name: Package
9696
run: cmake --build build --target package

.github/workflows/macos-build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##############################################################################
2-
# Copyright 2022-2024 Leon Lynch
2+
# Copyright 2022-2025 Leon Lynch
33
#
44
# This file is licensed under the terms of the LGPL v2.1 license.
55
# See LICENSE file.
@@ -42,7 +42,7 @@ jobs:
4242
run: cmake -B build -DCMAKE_OSX_ARCHITECTURES="${{ matrix.osx_arch }}" -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DFETCH_MBEDTLS=${{ matrix.fetch_deps }} -DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} -DFETCH_ARGP=${{ matrix.fetch_deps }}
4343

4444
- name: Build
45-
run: cmake --build build
45+
run: cmake --build build -j 4
4646

4747
- name: Test
48-
run: ctest --test-dir build --output-on-failure
48+
run: ctest --test-dir build --output-on-failure -j 4

.github/workflows/ubuntu-build.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug"
3838

3939
- name: Build
40-
run: cmake --build build
40+
run: cmake --build build -j 4
4141

4242
- name: Test
43-
run: ctest --test-dir build --output-on-failure
43+
run: ctest --test-dir build --output-on-failure -j 4
4444

4545
build-ubuntu-sanitizers:
4646
strategy:
@@ -72,10 +72,10 @@ jobs:
7272
-DTR31_ENABLE_SANITIZERS=ON
7373
7474
- name: Build
75-
run: cmake --build build
75+
run: cmake --build build -j 4
7676

7777
- name: Test with sanitizers
78-
run: ctest --test-dir build --output-on-failure
78+
run: ctest --test-dir build --output-on-failure -j 4
7979

8080
build-ubuntu-hardening:
8181
name: Ubuntu (hardening)
@@ -101,10 +101,10 @@ jobs:
101101
-DTR31_ENABLE_HARDENING=ON
102102
103103
- name: Build
104-
run: cmake --build build
104+
run: cmake --build build -j 4
105105

106106
- name: Test
107-
run: ctest --test-dir build --output-on-failure
107+
run: ctest --test-dir build --output-on-failure -j 4
108108

109109
build-ubuntu-legacy-release:
110110
strategy:
@@ -161,10 +161,10 @@ jobs:
161161
-DCPACK_DEBIAN_PACKAGE_RELEASE="0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1"
162162
163163
- name: Build
164-
run: cmake --build build
164+
run: cmake --build build -j 4
165165

166166
- name: Test
167-
run: cmake --build build --target test
167+
run: cmake --build build --target test -j 4
168168

169169
- name: Package
170170
run: cmake --build build --target package
@@ -217,10 +217,10 @@ jobs:
217217
-DCPACK_DEBIAN_PACKAGE_RELEASE="0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1"
218218
219219
- name: Build
220-
run: cmake --build build
220+
run: cmake --build build -j 4
221221

222222
- name: Test
223-
run: ctest --test-dir build --output-on-failure
223+
run: ctest --test-dir build --output-on-failure -j 4
224224

225225
- name: Package
226226
run: cmake --build build --target package

.github/workflows/windows-build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##############################################################################
2-
# Copyright 2022-2024 Leon Lynch
2+
# Copyright 2022-2025 Leon Lynch
33
#
44
# This file is licensed under the terms of the LGPL v2.1 license.
55
# See LICENSE file.
@@ -64,7 +64,7 @@ jobs:
6464
run: cmake -G Ninja -B build -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} -DFETCH_MBEDTLS=${{ matrix.fetch_deps }} -DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} -DFETCH_ARGP=YES
6565

6666
- name: Build
67-
run: cmake --build build
67+
run: cmake --build build -j 4
6868

6969
- name: Test
70-
run: ctest --test-dir build --output-on-failure
70+
run: ctest --test-dir build --output-on-failure -j 4

0 commit comments

Comments
 (0)