Skip to content

CI(OSGeo4W): patch landam package #2226

CI(OSGeo4W): patch landam package

CI(OSGeo4W): patch landam package #2226

Workflow file for this run

---
name: OSGeo4W
on:
push:
branches:
- main
- releasebranch_*
pull_request:
jobs:
build:
name: ${{ matrix.os }} build and tests
concurrency:
group: >-
${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.os }}
cancel-in-progress: true
runs-on: ${{ matrix.os }}
env:
PYTHONWARNINGS: always
strategy:
matrix:
os:
- windows-2019
fail-fast: false
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2.25.0
id: msys2
with:
path-type: inherit
location: D:\
update: true
msystem: MINGW64
install: >-
tar libintl make bison flex diffutils git dos2unix zip mingw-w64-x86_64-toolchain
mingw-w64-x86_64-fftw mingw-w64-x86_64-openblas mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-gcc mingw-w64-x86_64-ccache mingw-w64-x86_64-zlib mingw-w64-x86_64-libiconv
mingw-w64-x86_64-bzip2 mingw-w64-x86_64-gettext mingw-w64-x86_64-libsystre
mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git
mingw-w64-x86_64-pcre mingw-w64-x86_64-omp mingw-w64-x86_64-lapack
- run: printenv | sort
shell: msys2 {0}
- run: |
progfiles86="$(printenv "ProgramFiles(x86)")"
echo "$progfiles86"
shell: msys2 {0}
- run: |
echo "Calling vswhere"
"$(printenv "ProgramFiles(x86)")/Microsoft Visual Studio/Installer/vswhere.exe" -? || true
shell: msys2 {0}
- name: Setup OSGeo4W environment
uses: echoix/setup-OSGeo4W@f4311523e39f2c8b10e34ebbc3f2ff437ecfb9ed # v0.2.0
id: osgeo4w
with:
package-dir: "D:/OSGeo4W_pkg"
packages: |
cairo-devel
freetype-devel
gdal-devel
geos-devel
libjpeg-turbo-devel
liblas-devel
libpng-devel
libpq-devel
libtiff-devel
netcdf-devel
proj-devel
python3-core
python3-jupyter
python3-matplotlib
python3-numpy
python3-pip
python3-ply
python3-pytest
python3-pywin32
python3-six
python3-wxpython
sqlite3-devel
zstd-devel
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
- name: Restore ccache cache files
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
id: restore-cache
with:
path: .ccache
key: ${{ matrix.os }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.os }}-ccache-
- name: Configure ccache
run: |
echo "CCACHE_BASEDIR=${GITHUB_WORKSPACE}" >> "${GITHUB_ENV}"
echo "CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache" >> "${GITHUB_ENV}"
echo "CCACHE_MAXSIZE=400M" >> "${GITHUB_ENV}"
shell: msys2 {0}
- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
shell: msys2 {0}
- name: Compile GRASS GIS
shell: msys2 {0}
run: |
ccache --show-stats
MSYSPATH=$(cygpath -a msys64/usr/bin):$OSGEO4W_ROOT_MSYS/bin:$(cygpath --sysdir)
MSYSPATH=${MSYSPATH//\/cygdrive/}
ccache --show-config
ccache --zero-stats
PATH=$MSYSPATH:$PATH mswindows/osgeo4w/package.sh
ccache --show-stats --verbose --verbose
env:
PACKAGE_POSTFIX: "-dev"
OSGEO4W_ROOT: ${{ steps.osgeo4w.outputs.root }}
OSGEO4W_ROOT_MSYS: "/c/OSGeo4W"
PACKAGE_PATCH: ${{ github.sha }}-1
- name: Upload OSGeo4W grass package artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: grass-osgeo4w-package-${{ matrix.os }}
path: mswindows/osgeo4w/package
include-hidden-files: true
retention-days: 3
- name: Save ccache early
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: .ccache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
- name: Add msys to paths loaded by OSGeo4W
run: |
$msys_path=";$env:MSYS2_ROOT/usr/bin;$env:MSYS2_ROOT/mingw64/bin"
$line="set PATH=%OSGEO4W_ROOT%\bin${msys_path};%PATH%"
$line | Out-File -FilePath $env:OSGEO4W_ROOT/etc/ini/z_msys.bat
env:
MSYS2_ROOT: ${{ steps.msys2.outputs.msys2-location }}
OSGEO4W_ROOT: ${{ steps.osgeo4w.outputs.root }}
continue-on-error: true
- name: Print installed versions
if: always()
shell: msys2 {0}
run: |
export ARCH=x86_64-w64-mingw32
PWD="$(pwd)"
SRC="${PWD}"
export PATH="${OSGEO4W_ROOT_MSYS}/bin:/usr/bin:/mingw64/bin:${SRC}/dist.${ARCH}/bin:${OSGEO4W_ROOT_MSYS}/apps/grass/grass85/etc:${PATH}"
export PYTHONHOME=${OSGEO4W_ROOT_MSYS}/apps/Python312
.github/workflows/print_versions.sh
env:
OSGEO4W_ROOT_MSYS: "/c/OSGeo4W"
continue-on-error: true
- name: Test executing of the grass command
run: .github/workflows/test_simple.bat '${{env.O4WROOT}}\bin\grass85.bat'
env:
O4WROOT: ${{ steps.osgeo4w.outputs.root }}
- name: Test executing of the grass command in bash
shell: msys2 {0}
run: .github/workflows/test_simple.sh
continue-on-error: true # TODO
- name: Test executing of the grass command in bash msys
shell: msys2 {0}
run: |
PWD="$(pwd)"
SRC="${PWD}"
export ARCH=x86_64-w64-mingw32
export PATH="${OSGEO4W_ROOT_MSYS}/bin:/usr/bin:/mingw64/bin:${SRC}/dist.${ARCH}/bin:${SRC}/dist.${ARCH}/$bash_bin:${OSGEO4W_ROOT_MSYS}/apps/grass/grass85/etc"
export PYTHONHOME=${OSGEO4W_ROOT_MSYS}/apps/Python312
export PYTHONHOME="${PYTHONHOME}"
export PYTHONUTF8=1
export GISBASE=${OSGEO4W_ROOT}/apps/grass/grass85
printenv | sort
.github/workflows/test_simple_msys.sh
continue-on-error: true
env:
OSGEO4W_ROOT_MSYS: "/c/OSGeo4W"
OSGEO4W_ROOT: ${{ steps.osgeo4w.outputs.root }}
- name: Install pytest plugins
run: python -m pip install pytest-timeout
shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}""
- name: Run pytest with a single worker
run: |
call %OSGEO4W_ROOT%\apps\grass\grass85\etc\env.bat
set PYTHONPATH=%GISBASE%\etc\python;%PYTHONPATH%
path %GISBASE%\lib;%GISBASE%\bin;%PATH%
pytest --verbose --color=yes ^
--durations=0 --durations-min=0.5 ^
-ra .
shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}""
- name: Run tests
run: .github/workflows/test_thorough.bat '${{env.O4WROOT}}\bin\grass85.bat' '${{env.O4WROOT}}\bin\python3'
env:
O4WROOT: ${{ steps.osgeo4w.outputs.root }}
- name: Make HTML test report available
if: ${{ always() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: testreport-${{ matrix.os }}
path: testreport
retention-days: 3