Skip to content

CI with latest GRASS GIS #1159

CI with latest GRASS GIS

CI with latest GRASS GIS #1159

Workflow file for this run

name: CI with latest GRASS GIS
on:
push:
branches:
- main
pull_request:
paths-ignore:
- "*.md"
- CITATION.cff
- LICENSE
schedule:
# 01:00 Pacific Time (in UTC), every day (morning)
- cron: '0 8 * * *'
jobs:
build:
name: compiled ${{ matrix.version }}
strategy:
matrix:
include:
- version: main
command: grass
- version: releasebranch_8_2
command: grass
- version: releasebranch_8_0
command: grass
fail-fast: false
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: true
- 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: Get Python version
run: |
python3 --version
python --version
- name: Create installation directory
run: |
mkdir $HOME/install
- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Set LD_LIBRARY_PATH for GRASS GIS compilation
run: |
echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
- name: Get and build GRASS GIS
run: |
.github/workflows/build.sh /tmp $HOME/install ${{ matrix.version }}
- name: Add the bin directory to PATH
run: |
echo "$HOME/install/bin" >> $GITHUB_PATH
- name: Make simple grass command available
run: |
if [ ! -f "$HOME/install/bin/grass" ]; then
ln -s "$HOME/install/bin/${{ matrix.command }}" "$HOME/install/bin/grass"
fi
- name: Get GRASS GIS version
run: |
grass --version
- name: Install the module
run: |
grass --tmp-location XY --exec g.extension extension=r.pops.spread url=. --verbose
- name: Cache data for testing
id: cache-nc_spm_08_grass7
uses: actions/cache@v1
with:
path: nc_spm_08_grass7
key: ${{ runner.os }}-nc_spm_08_grass7
- name: Get data download tool for v7 (g.download.location)
if: steps.cache-nc_spm_08_grass7.outputs.cache-hit != 'true' && matrix.version == 'releasebranch_7_8'
run: |
grass --tmp-location XY --exec g.extension g.download.location --verbose
- name: Get sample data for testing (NC SPM sample location)
if: steps.cache-nc_spm_08_grass7.outputs.cache-hit != 'true'
run: |
grass --tmp-location XY --exec g.download.location url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_08_grass7.tar.gz path=~ --verbose
- name: Run test (manually specified files)
run: |
cd testsuite/
grass -c ~/nc_spm_08_grass7/test --exec ./test_r_pops_spread.py
rm -rf ~/nc_spm_08_grass7/test