Skip to content

Commit 7156224

Browse files
committed
gh workflow: Use parallel make for builds
Use parallel make for builds. We use the GNU coreutils' "nproc" utility to determine the number of cores available for us to use. We then tell make to launch up to that number of processes (-j$(nproc)) in parallel, but only if the system load is below $(nproc) (-l$(nproc)). That should make reasonably good use of however many cores github makes available to us, while not overloading the build server or the build server VM.
1 parent 82251c0 commit 7156224

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/ccpp.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ jobs:
1515
- uses: actions/checkout@v2
1616
- name: apt-get install
1717
run: sudo apt-get update && sudo apt-get install -y autopoint gettext libusb-1.0-0-dev libcurl4-openssl-dev libgd-dev
18-
- name: nproc
19-
run: nproc
2018
- name: autoreconf
2119
run: autoreconf -i -f
2220
- name: configure
2321
run: ./configure --prefix=$PWD/__prefix
2422
- name: make
25-
run: make
23+
run: make -j$(nproc) -l$(nproc)
2624
- name: make check
27-
run: make check
25+
run: set -x; make -j$(nproc) -l$(nproc) check
2826
- name: make distcheck
29-
run: make distcheck
27+
run: make -j$(nproc) -l$(nproc) distcheck
3028
- name: make install
31-
run: make install
29+
run: make -j$(nproc) -l$(nproc) install
30+
- name: make installcheck
31+
run: make -j$(nproc) -l$(nproc) installcheck
3232
- name: build and run example libgphoto2 frontend (ambs-lgp2-frontend)
3333
run: |
3434
set -x

0 commit comments

Comments
 (0)