summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2022-05-14 00:48:52 +0200
committerHans Ulrich Niedermann <hun@n-dimensional.de>2022-05-19 16:59:58 +0200
commitd1650f14bc3a69ad27dcc6c9f02b8f171adf3379 (patch)
treed64f6ecd52d2483c0c3abdf0d7bf515aeff93e53 /.github
parentf727fa6e2d1f9e18c8cff3f5725b426630fc41b7 (diff)
downloadlibgphoto2-d1650f14bc3a69ad27dcc6c9f02b8f171adf3379.tar.gz
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.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ccpp.yml10
1 files changed, 4 insertions, 6 deletions
diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml
index 7a3ca7dc2..89df3b562 100644
--- a/.github/workflows/ccpp.yml
+++ b/.github/workflows/ccpp.yml
@@ -15,20 +15,18 @@ jobs:
- uses: actions/checkout@v2
- name: apt-get install
run: sudo apt-get update && sudo apt-get install -y autopoint gettext libusb-1.0-0-dev libcurl4-openssl-dev libgd-dev
- - name: nproc
- run: nproc
- name: autoreconf
run: autoreconf -i -f
- name: configure
run: ./configure --prefix=$PWD/__prefix
- name: make
- run: make
+ run: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC
- name: make check
- run: make check
+ run: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC check
- name: make distcheck
- run: make distcheck
+ run: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC distcheck
- name: make install
- run: make install
+ run: NPROC=$(nproc); set -x; make -j$NPROC -l$NPROC install
- name: build and run example libgphoto2 frontend (ambs-lgp2-frontend)
run: |
set -x