-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub actions: compile driver on Ubuntu (#1)
Compile GDAL-GRASS driver including tests for GRASS GIS raster and vector maps.
- Loading branch information
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gdal-bin | ||
grass | ||
grass-dev | ||
libgdal-dev | ||
libpq-dev | ||
pkg-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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 | ||
|
||
# versionless in future? | ||
GRASS=grass$(pkg-config --modversion grass | cut -d. -f1,2 | sed 's+\.++g') | ||
|
||
export GDAL_AUTOLOAD_DIR=$1 | ||
|
||
./configure \ | ||
--prefix=/usr \ | ||
--with-autoload=${GDAL_AUTOLOAD_DIR} \ | ||
--with-grass=/usr/lib/${GRASS} \ | ||
--with-postgres-includes=$(pg_config --includedir) | ||
|
||
make | ||
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/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 | ||
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 ) | ||
|
||
# Using LD_LIBRARY_PATH workaround for GRASS GIS < 7.8.8 | ||
export LD_LIBRARY_PATH=$(grass --config path)/lib | ||
|
||
# test GRASS GIS raster map | ||
gdalinfo $HOME/grassdata/nc_spm_08_micro/PERMANENT/cellhd/elevation | ||
|
||
# test GRASS GIS vector map | ||
ogrinfo -so -al $HOME/grassdata/nc_spm_08_micro/PERMANENT/vector/firestations/head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build on Ubuntu | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Get dependencies | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y wget git gawk findutils | ||
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ | ||
sudo apt-get install -y --no-install-recommends --no-install-suggests | ||
- name: Create GDAL_AUTOLOAD directory | ||
run: | | ||
mkdir $HOME/gdalplugins | ||
- 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 | ||
|