ajout licence CC #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validation du schémaRNG | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name : Récupérer le dépôt | |
| uses: actions/checkout@v5 | |
| - name: Installer Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Télécharger Jing | |
| run: | | |
| curl -L -o jing.zip https://github.com/relaxng/jing-trang/releases/download/V20220510/jing-20220510.zip | |
| unzip jing.zip | |
| - name: Vérifier jing | |
| run: | | |
| ls | |
| ls jing-20220510 | |
| ls jing-20220510/bin | |
| - name: Vérifier l’arborescence | |
| run: | | |
| ls -R | |
| - name: Valider les fichiers XML valides | |
| run: | | |
| shopt -s nullglob | |
| files=(tei/glossaire/test/valides/*.xml) | |
| if [ ${#files[@]} -eq 0 ]; then | |
| echo "Aucun fichier XML trouvé dans tei/glossaire/test/valides/" | |
| exit 1 | |
| fi | |
| FAIL=0 | |
| for file in "${files[@]}"; do | |
| echo "================================" | |
| echo "Validation attendue (succès) : $file" | |
| if java -jar jing-20220510/bin/jing.jar schemas/glossaire-tei.rng "$file"; then | |
| echo "✅ Validation réussie pour $file" | |
| else | |
| echo "❌ Ce fichier valide a échoué : $file" | |
| FAIL=1 | |
| fi | |
| done | |
| echo "================================" | |
| if [ $FAIL -ne 0 ]; then | |
| echo "Au moins un fichier valide a échoué." | |
| exit 1 | |
| else | |
| echo "Tous les fichiers valides ont été validés avec succès." | |
| fi | |
| - name: Valider les fichiers XML invalides | |
| run: | | |
| shopt -s nullglob | |
| files=(tei/glossaire/test/invalides/*.xml) | |
| if [ ${#files[@]} -eq 0 ]; then | |
| echo "Aucun fichier XML trouvé dans tei/glossaire/test/invalides/" | |
| exit 1 | |
| fi | |
| FAIL=0 | |
| for file in "${files[@]}"; do | |
| echo "================================" | |
| echo "Validation attendue (échec) : $file" | |
| if java -jar jing-20220510/bin/jing.jar schemas/glossaire-tei.rng "$file"; then | |
| echo "❌ Ce fichier invalide est passé alors qu’il devrait échouer : $file" | |
| FAIL=1 | |
| else | |
| echo "✅ Échec attendu pour $file" | |
| fi | |
| done | |
| echo "================================" | |
| if [ $FAIL -ne 0 ]; then | |
| echo "Au moins un fichier invalide est passé à tort." | |
| exit 1 | |
| else | |
| echo "Tous les fichiers invalides ont bien échoué." | |
| fi | |
| - name: Notification Discord succès | |
| if: success() | |
| run: | | |
| curl -H "Content-Type: application/json" \ | |
| -d '{"content":"✅ Validation RNG : SUCCES — ${{ github.repository }} — branche ${{ github.ref_name }}"}' \ | |
| "${{ secrets.DISCORD_WEBHOOK_URL }}" | |
| - name: Notification Discord échec | |
| if: failure() | |
| run: | | |
| curl -H "Content-Type: application/json" \ | |
| -d '{"content":"❌ Validation RNG : ECHEC — ${{ github.repository }} — branche ${{ github.ref_name }}"}' \ | |
| "${{ secrets.DISCORD_WEBHOOK_URL }}" |