Skip to content

Commit

Permalink
CI: Test also without OpenMP and pthreads (OSGeo#2245)
Browse files Browse the repository at this point in the history
This adds an additional build configuration to the Ubuntu workflow which builds code without OpenMP and pthreads and runs tests. Notably, modules using nprocs parameter should accept nprocs > 1 even when they are not able to parallelize due to a missing dependency. This check tests that behavior.

Other selected optional dependencies can be added in the future. The current goal is to test code without dependencies which don't influence the primary actions the code performs.
  • Loading branch information
wenzeslaus authored and ninsbl committed Oct 26, 2022
1 parent ff86183 commit 7c6e6f3
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build_ubuntu-20.04_without_x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash

# The make step requires something like:
# export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PREFIX/lib"
# further steps additionally require:
# export PATH="$PATH:$PREFIX/bin"

# fail on non-zero return code from a subprocess
set -e

# print commands
set -x

if [ -z "$1" ]; then
echo "Usage: $0 PREFIX"
exit 1
fi

# Adding -Werror to make's CFLAGS is a workaround for configuring with
# an old version of configure, which issues compiler warnings and
# errors out. This may be removed with upgraded configure.in file.
makecmd="make"
if [[ "$#" -eq 2 ]]; then
makecmd="make CFLAGS='$CFLAGS $2' CXXFLAGS='$CXXFLAGS $2'"
fi

# non-existent variables as an errors
set -u

export INSTALL_PREFIX=$1

./configure \
--prefix="$INSTALL_PREFIX/" \
--enable-largefile \
--with-cxx \
--with-zstd \
--with-bzlib \
--with-blas \
--with-lapack \
--with-readline \
--without-openmp \
--with-pdal \
--without-pthread \
--with-tiff \
--with-freetype \
--with-freetype-includes="/usr/include/freetype2/" \
--with-proj-share=/usr/share/proj \
--with-geos \
--with-sqlite \
--with-fftw \
--with-netcdf

eval $makecmd
make install
16 changes: 12 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ on:

jobs:
build-and-test:
name: ${{ matrix.os }} tests
name: ${{ matrix.name }} tests

runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
include:
- name: "20.04"
os: ubuntu-20.04
config: ubuntu-20.04
# This is without optional things but it still keeps things useful,
# so, e.g., without OpenMP, but with PDAL. Code or tests should be written
# so that test pass even when these optional things are not present.
- name: "minimum config"
os: ubuntu-20.04
config: ubuntu-20.04_without_x
fail-fast: false

steps:
Expand All @@ -39,7 +47,7 @@ jobs:
echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
- name: Build
run: .github/workflows/build_${{ matrix.os }}.sh $HOME/install
run: .github/workflows/build_${{ matrix.config }}.sh $HOME/install

- name: Add the bin directory to PATH
run: |
Expand Down

0 comments on commit 7c6e6f3

Please sign in to comment.