CI with latest GRASS GIS #1203
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
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 | |
- version: releasebranch_8_4 | |
fail-fast: false | |
runs-on: ubuntu-24.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: 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 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 |