Files
Synthese-PSM_LARRA/.github/workflows/pyThtoQgis.yml
T

99 lines
3.2 KiB
YAML

name: pyThtoQgis
on:
push:
paths:
- 'Outputs/SHP/*.shp'
workflow_dispatch:
permissions:
contents: write
jobs:
convert:
runs-on: ubuntu-latest
steps:
# ------------------------------------------------------------
# Récupération du dépôt
# ------------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v6
# ------------------------------------------------------------
# Installation de Python
# ------------------------------------------------------------
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
# ------------------------------------------------------------
# Installation de GDAL + SFCGAL
# ------------------------------------------------------------
- name: Install GDAL and SFCGAL
run: |
sudo apt-get update
sudo apt-get install -y \
gdal-bin \
libgdal-dev \
sfcgal-bin \
libsfcgal-dev
# ------------------------------------------------------------
# Vérification de GDAL et SFCGAL
# ------------------------------------------------------------
- name: Check GDAL and SFCGAL
run: |
echo "=== GDAL ==="
gdal-config --version
which gdal-config
echo
echo "=== SFCGAL ==="
sfcgal-config --version || true
which sfcgal-config || true
# ------------------------------------------------------------
# Installation des bibliothèques Python
# ------------------------------------------------------------
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install numpy
pip install alive-progress
# Bindings Python correspondant à la version
# de GDAL installée par Ubuntu
pip install "gdal[numpy]==$(gdal-config --version).*"
# ------------------------------------------------------------
# Vérification des bindings Python
# ------------------------------------------------------------
- name: Test Python dependencies
run: |
python -c "import numpy; print('NumPy:', numpy.__version__)"
python -c "from osgeo import gdal; print('GDAL Python:', gdal.__version__)"
python -c "from osgeo import ogr; print('OGR OK')"
python -c "from alive_progress import alive_bar; print('alive-progress OK')"
# ------------------------------------------------------------
# Exécution de pyThtoQgis
# ------------------------------------------------------------
- name: Run pyThtoQgis
working-directory: Scripts/pyThtoQgis
run: |
python pyThtoQgis.py --folder "../../Outputs/SHP/"
# ------------------------------------------------------------
# Commit des résultats
# ------------------------------------------------------------
- name: Commit generated files
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "Auto-run pyThtoQgis"