Enable the use of an optional RSLC product to generate static layers (WIP) #576
Workflow file for this run
This file contains hidden or 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: 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 | |
| - deps: | |
| label: Documentation | |
| extra-specs: >- | |
| doxygen | |
| mkdocs | |
| mkdocs-material | |
| pdoc | |
| pymdown-extensions | |
| # Build with CUDA so the Python CUDA extension is documented, | |
| # but don't try to run the tests since we're on a CPU-only builder. | |
| extra-cmake-args: -DWITH_CUDA=ON | |
| 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 }} | |
| - name: Install CUDA Toolkit | |
| if: matrix.deps.label == 'Documentation' | |
| run: | | |
| micromamba install -c nvidia cuda | |
| # 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 \ | |
| ${{ matrix.extra-cmake-args }} \ | |
| . | |
| # 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 | |
| if: matrix.deps.label != 'Documentation' | |
| run: | | |
| cd build | |
| export GDAL_MEM_ENABLE_OPEN=YES | |
| ctest --output-on-failure ${{ env.ctest-exclude }} | |
| - name: Build documentation | |
| if: matrix.deps.label == 'Documentation' | |
| run: | | |
| mkdocs build -d build/docs-output | |
| # XXX Manually create doxygen output dir, why doesn't CREATE_SUBDIRS in the config work? | |
| mkdir -p build/docs-output/api/cxx/ | |
| doxygen build/doc/doxygen/Doxyfile | |
| export PYTHONPATH="$PYTHONPATH:$ISCE3_PREFIX/packages" | |
| pdoc -o build/docs-output/api/python --math install/packages/isce3 | |
| - name: Deploy documentation | |
| if: matrix.deps.label == 'Documentation' && github.ref == 'refs/heads/develop' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./build/docs-output |