Skip to content

Commit eb63ef9

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 eb63ef9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/ccpp.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,18 @@ 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: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC
2624
- name: make check
27-
run: make check
25+
run: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC check
2826
- name: make distcheck
29-
run: make distcheck
27+
run: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC distcheck
3028
- name: make install
31-
run: make install
29+
run: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC install
3230
- name: build and run example libgphoto2 frontend (ambs-lgp2-frontend)
3331
run: |
3432
set -x

0 commit comments

Comments
 (0)