Skip to content

Merge pull request #18 from Trailblaze-Software/slope-fix #88

Merge pull request #18 from Trailblaze-Software/slope-fix

Merge pull request #18 from Trailblaze-Software/slope-fix #88

# QGIS Plugin CI for Blaze
# This GitHub Actions workflow uses the official QGIS Docker image for plugin testing
---
name: QGIS Plugin Pipeline Test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
container:
image: qgis/qgis:latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
chmod +x scripts/install-ubuntu-deps.sh
./scripts/install-ubuntu-deps.sh
- name: Build blaze-cli
run: |
cmake -S . -B build -G Ninja
cmake --build build --target blaze-cli
- name: Run blaze-cli to generate output
working-directory: ${{ github.workspace }}
run: |
./build/blaze-cli assets/default_config.json assets/sample.laz
- name: Run create_qgis_project.py with QGIS
run: |
export PYTHONPATH=/usr/share/qgis/python:$PYTHONPATH
export LD_LIBRARY_PATH=/usr/lib/qgis:$LD_LIBRARY_PATH
export BLAZE_COMBINED_DIR=assets/out/combined
export BLAZE_OUTPUT_PATH=assets/out/combined.qgz
export BLAZE_EXIT_AFTER_RUN=1
export BLAZE_SKIP_TOPO_DOWNLOAD=1
export QT_QPA_PLATFORM=offscreen
# Invoke the script as a standalone PyQGIS Python program (with
# python -u for unbuffered output) rather than via `qgis --code`.
# The `qgis --code` path was not executing the script at all in the
# containerised, offscreen environment (QGIS's Python console isn't
# initialised before startup hangs), so nothing from the script ever
# appeared in logs. The script now creates its own headless
# QgsApplication when run this way — see its __main__ block.
timeout 300 python3 -u qgis_plugin/blaze_loader/create_qgis_project.py
- name: Check for QGIS project
run: |
test -f assets/out/combined.qgz
- name: Upload QGIS project with all layers
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: qgis-project
path: |
assets/out/combined.qgz
assets/out/combined/
retention-days: 2