Skip to content

Add an extra margin to the RSLC LUT extents #614

Add an extra margin to the RSLC LUT extents

Add an extra margin to the RSLC LUT extents #614

Workflow file for this run

name: Build-And-Run Tests
on:
pull_request:
push:
branches:
- develop
- release-*
tags:
- v*.*.*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build_and_test:
env:
ALL_EXCLUDE: stage_dem|pybind\.unwrap\.phass
# stage_dem requires AWS permissions to access the S3 bucket containing the DEM data.
# pybind.unwrap.phass occasionally segfaults on GHA runners.
# Default values for optional matrix parameters
env-file: ${{ matrix.deps.env-file || 'environment.yml' }}
ctest-exclude: ${{ matrix.os.ctest_exclude || '-E ".*($ALL_EXCLUDE)"'}}
extra-specs: ${{ matrix.deps.extra-specs || '' }}
build-type: ${{ matrix.build-type || 'RelWithDebInfo' }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os:
- label: Linux
- label: macOS
runner: macos-latest
ctest_exclude: -E ".*($ALL_EXCLUDE|io\.gdal\.raster|unwrap\.snaphu|background)"
# io.gdal.raster and unwrap.snaphu tests fail due to known unresolved issues
# with GDAL memory mapping on macOS.
# background reader/writer test sometimes fails on macOS due to slow runtimes.
deps:
- label: Latest
build-type: [ Release, Debug ]
include:
- deps:
label: Minimum Python supported
extra-specs: |
python=3.9
name: Build And Test - ${{ matrix.os.label }} ${{ matrix.deps.label }} ${{ matrix.build-type }}
runs-on: ${{ matrix.os.runner || 'ubuntu-latest' }}
steps:
# Typical github repo checkout step
- name: Github Repo Checkout
uses: actions/checkout@v3
# Prints the variables for this run to simplify debugging
- name: Print Run Variables
run: |
echo Runner OS: ${{ matrix.os.runner || 'ubuntu-latest' }}
echo Environment: ${{ env.env-file }}
echo Build Type: ${{ env.build-type }}
echo ctest exclude command: ${{ env.ctest_exclude }}
echo Dependencies: ${{ env.extra-specs }}
# Set the conda environment up using Mamba and the dependencies for this run
- name: Setup Environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ${{ env.env-file }}
environment-name: isce3
create-args: >-
${{ env.extra-specs }}
# Fix missing conda command on macOS
- name: macOS conda command fixup
if: runner.os == 'macOS'
run: |
micromamba install conda
# Preset environment variables in the conda environment for later steps
- name: Environment Variables Preset
run: |
conda env config vars set ISCE3_PREFIX=$GITHUB_WORKSPACE/install
conda env config vars set PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE/install/packages
# Get cmake command configured with relevant build information
- name: Configure cmake
run: |
# Hack: fix for missing cstdint include in pybind11 headers
CFLAGS="$CFLAGS -include cstdint" \
cmake \
-B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.build-type }} \
-DCMAKE_INSTALL_PREFIX=$ISCE3_PREFIX \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
.
# Build the project
- name: Build Project
run: |
cmake --build build --parallel
# Install the project
- name: Install Project
run: |
cmake --build build --target install --parallel
# Set the LD_LIBRARY_PATH and DYLD_LIBRARY_PATH variables
- name: Set Link Library Environment Variable
# Append to DYLD_LIBRARY_PATH on macOS or to LD_LIBRARY_PATH on Linux.
# Depending on the Linux flavor, the install dir name could be 'lib64' or 'lib'.
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
conda env config vars set DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ISCE3_PREFIX/lib
elif test -d "$ISCE3_PREFIX/lib64"; then
conda env config vars set LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ISCE3_PREFIX/lib64
else
conda env config vars set LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ISCE3_PREFIX/lib
fi
# Run ctest on the project with the intended test exclusions for this run
- name: Test Project
run: |
cd build
export GDAL_MEM_ENABLE_OPEN=YES
ctest --output-on-failure ${{ env.ctest-exclude }}