Files
Synthese-PSM_LARRA/.github/workflows/pyThtoQgis.yml
T
Alex38Lyon e6750d1851 Remove SHP geometry inspection from workflow
Removed SHP geometry inspection step from workflow.
2026-08-28 15:24:55 +02:00

146 lines
4.5 KiB
YAML

name: pyThtoQgis
on:
push:
paths:
- 'Outputs/SHP/*.shp'
# Permet de lancer l'action manuellement
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 et SFCGAL
# ------------------------------------------------------------
- name: Install GDAL and SFCGAL
run: |
sudo apt-get update
sudo apt-get install -y \
gdal-bin \
libgdal-dev \
libsfcgal-dev
# ------------------------------------------------------------
# Vérification de GDAL
# ------------------------------------------------------------
- name: Check GDAL
run: |
echo "========================================"
echo "GDAL système"
echo "========================================"
gdal-config --version
echo
echo "gdal-config :"
which gdal-config
echo
echo "GDAL --version :"
gdalinfo --version
# ------------------------------------------------------------
# Installation des bibliothèques Python
# ------------------------------------------------------------
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install numpy
pip install alive-progress
# Installation des bindings Python GDAL
# correspondant à la version de GDAL du système
pip install "gdal[numpy]==$(gdal-config --version).*"
# ------------------------------------------------------------
# Vérification des bibliothèques Python
# ------------------------------------------------------------
- name: Test Python dependencies
run: |
echo "========================================"
echo "Python"
echo "========================================"
python --version
echo
echo "========================================"
echo "NumPy"
echo "========================================"
python -c "import numpy; print(numpy.__version__)"
echo
echo "========================================"
echo "GDAL Python"
echo "========================================"
python -c "from osgeo import gdal; print(gdal.__version__)"
echo
echo "========================================"
echo "OGR"
echo "========================================"
python -c "from osgeo import ogr; print('OGR OK')"
echo
echo "========================================"
echo "alive-progress"
echo "========================================"
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/"
# ------------------------------------------------------------
# Affichage des fichiers générés/modifiés
# ------------------------------------------------------------
- name: Show generated files
run: |
echo "========================================"
echo "Fichiers modifiés"
echo "========================================"
git status --short
# ------------------------------------------------------------
# Commit des résultats
# ------------------------------------------------------------
- name: Commit generated files
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "Auto-run pyThtoQgis"