Refactor pyThtoQgis workflow for better diagnostics

Updated workflow to improve GDAL and SFCGAL installation checks, added diagnostics for SHP files, and enhanced Python dependency verification.
This commit is contained in:
Alex38Lyon
2026-08-28 15:19:32 +02:00
committed by GitHub
parent ee39df03e7
commit c1b9f6a28f
+89 -13
View File
@@ -5,6 +5,7 @@ on:
paths: paths:
- 'Outputs/SHP/*.shp' - 'Outputs/SHP/*.shp'
# Permet de lancer l'action manuellement
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@@ -31,7 +32,7 @@ jobs:
python-version: '3.12' python-version: '3.12'
# ------------------------------------------------------------ # ------------------------------------------------------------
# Installation de GDAL + SFCGAL # Installation de GDAL et SFCGAL
# ------------------------------------------------------------ # ------------------------------------------------------------
- name: Install GDAL and SFCGAL - name: Install GDAL and SFCGAL
run: | run: |
@@ -40,22 +41,26 @@ jobs:
sudo apt-get install -y \ sudo apt-get install -y \
gdal-bin \ gdal-bin \
libgdal-dev \ libgdal-dev \
sfcgal-bin \
libsfcgal-dev libsfcgal-dev
# ------------------------------------------------------------ # ------------------------------------------------------------
# Vérification de GDAL et SFCGAL # Vérification de GDAL
# ------------------------------------------------------------ # ------------------------------------------------------------
- name: Check GDAL and SFCGAL - name: Check GDAL
run: | run: |
echo "=== GDAL ===" echo "========================================"
echo "GDAL système"
echo "========================================"
gdal-config --version gdal-config --version
echo
echo "gdal-config :"
which gdal-config which gdal-config
echo echo
echo "=== SFCGAL ===" echo "GDAL --version :"
sfcgal-config --version || true gdalinfo --version
which sfcgal-config || true
# ------------------------------------------------------------ # ------------------------------------------------------------
# Installation des bibliothèques Python # Installation des bibliothèques Python
@@ -67,20 +72,80 @@ jobs:
pip install numpy pip install numpy
pip install alive-progress pip install alive-progress
# Bindings Python correspondant à la version # Installation des bindings Python GDAL
# de GDAL installée par Ubuntu # correspondant à la version de GDAL du système
pip install "gdal[numpy]==$(gdal-config --version).*" pip install "gdal[numpy]==$(gdal-config --version).*"
# ------------------------------------------------------------ # ------------------------------------------------------------
# Vérification des bindings Python # Vérification des bibliothèques Python
# ------------------------------------------------------------ # ------------------------------------------------------------
- name: Test Python dependencies - name: Test Python dependencies
run: | run: |
python -c "import numpy; print('NumPy:', numpy.__version__)" echo "========================================"
python -c "from osgeo import gdal; print('GDAL Python:', gdal.__version__)" 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')" 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')" python -c "from alive_progress import alive_bar; print('alive-progress OK')"
# ------------------------------------------------------------
# Diagnostic des fichiers SHP
#
# Uniquement les SHP directement dans Outputs/SHP/
# ------------------------------------------------------------
- name: Inspect SHP geometry
run: |
echo "========================================"
echo "Fichiers SHP détectés"
echo "========================================"
shopt -s nullglob
files=(Outputs/SHP/*.shp)
if [ ${#files[@]} -eq 0 ]; then
echo "Aucun fichier SHP trouvé."
exit 0
fi
for file in "${files[@]}"; do
echo
echo "========================================"
echo "$file"
echo "========================================"
ogrinfo -al -so "$file"
done
# ------------------------------------------------------------ # ------------------------------------------------------------
# Exécution de pyThtoQgis # Exécution de pyThtoQgis
# ------------------------------------------------------------ # ------------------------------------------------------------
@@ -89,6 +154,17 @@ jobs:
run: | run: |
python pyThtoQgis.py --folder "../../Outputs/SHP/" 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 # Commit des résultats
# ------------------------------------------------------------ # ------------------------------------------------------------