Files
Synthese-PSM_LARRA/.github/workflows/pyThtoQgis.yml
T
Alex38Lyon a10c4ae454 Update workflow to install GDAL and change Python version
Updated Python version and added GDAL installation steps. Modified dependency checks for GDAL and OGR.
2026-08-28 14:23:06 +02:00

93 lines
3.1 KiB
YAML

name: pyThtoQgis
on:
push:
paths:
- 'Outputs/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 au niveau système
# ------------------------------------------------------------
- name: Install GDAL system packages
run: |
sudo apt-get update
sudo apt-get install -y \
gdal-bin \
libgdal-dev
# ------------------------------------------------------------
# Vérification de GDAL
# ------------------------------------------------------------
- name: Check GDAL
run: |
echo "Version GDAL système :"
gdal-config --version
echo "Chemin gdal-config :"
which gdal-config
# ------------------------------------------------------------
# Installation des bibliothèques Python
# ------------------------------------------------------------
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install numpy
pip install alive-progress
# Installer exactement la version correspondant
# à la bibliothèque GDAL système
pip install "gdal[numpy]==$(gdal-config --version).*"
# ------------------------------------------------------------
# Vérification des bindings Python GDAL/OGR
# ------------------------------------------------------------
- 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/"
# ------------------------------------------------------------
# Enregistrement des résultats dans Git
# ------------------------------------------------------------
- name: Commit generated files
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "Auto-run pyThtoQgis"