Files
Synthese-PSM_LARRA/.github/workflows/pyThtoQgis.yml
T
Alex38Lyon 1bd59c5266 Refactor pyThtoQgis workflow for clarity and checks
Updated workflow to check generated files and modified comments.
2026-08-31 17:43:29 +02:00

154 lines
4.7 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 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
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/"
# ------------------------------------------------------------
# Vérification des fichiers générés
# ------------------------------------------------------------
- name: Check generated files
run: |
echo "========================================"
echo "GPKG et logs générés"
echo "========================================"
find Outputs -type f \( \
-name "*.gpkg" -o \
-name "pyThtoQgis.log" \
\) -print
echo
echo "========================================"
echo "Statut Git"
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"
file_pattern: 'Outputs/**/*.gpkg Outputs/**/pyThtoQgis.log'