diff --git a/.github/workflows/build_ubuntu_cmake.sh b/.github/workflows/build_ubuntu_cmake.sh new file mode 100755 index 0000000..0975def --- /dev/null +++ b/.github/workflows/build_ubuntu_cmake.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# fail on non-zero return code from a subprocess +set -e + +# print commands +set -x + +if [ -z "$1" ]; then + echo "Usage: $0 GDAL_AUTOLOAD_DIR" + exit 1 +fi + +# non-existent variables as an errors +set -u + +export GDAL_AUTOLOAD_DIR=$1 + +mkdir build && cd build + +cmake .. -DAUTOLOAD_DIR=${GDAL_AUTOLOAD_DIR} +cmake --build . +cmake --install . diff --git a/.github/workflows/test_simple.sh b/.github/workflows/test_simple.sh index 14091cb..1c2cf5c 100755 --- a/.github/workflows/test_simple.sh +++ b/.github/workflows/test_simple.sh @@ -14,15 +14,7 @@ fi # non-existent variables as an errors set -u -export GDAL_AUTOLOAD_DIR=$1 -export GDAL_DRIVER_PATH=${GDAL_AUTOLOAD_DIR} - -# add small GRASS GIS dataset for tests -(mkdir -p $HOME/grassdata && \ - cd $HOME/grassdata/ && \ - wget -c --quiet https://grass.osgeo.org/sampledata/north_carolina/nc_spm_08_micro.zip && \ - unzip nc_spm_08_micro.zip && \ - rm -f nc_spm_08_micro.zip ) +export GDAL_DRIVER_PATH=$1 # Using LD_LIBRARY_PATH workaround for GRASS GIS < 7.8.8 export LD_LIBRARY_PATH=$(grass --config path)/lib diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ba854b1..07ff1f1 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -21,7 +21,18 @@ jobs: - name: Create GDAL_AUTOLOAD directory run: | mkdir $HOME/gdalplugins + - name: Setup test data + run: | + mkdir -p $HOME/grassdata + cd $HOME/grassdata/ + wget -c --quiet https://grass.osgeo.org/sampledata/north_carolina/nc_spm_08_micro.zip + unzip nc_spm_08_micro.zip + rm -f nc_spm_08_micro.zip - name: Build run: .github/workflows/build_ubuntu.sh $HOME/gdalplugins - name: Test executing of GDAL with driver on GRASS maps run: .github/workflows/test_simple.sh $HOME/gdalplugins + - name: Build with CMake + run: .github/workflows/build_ubuntu_cmake.sh $HOME/gdalplugins_cmake + - name: Test executing of GDAL with driver on GRASS maps (CMake) + run: .github/workflows/test_simple.sh $HOME/gdalplugins_cmake