Añadida validación automatizada de formas SHACL del perfil DCAT-AP-ES #14
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: Validación formas SHACL | |
| on: | |
| pull_request: | |
| paths: | |
| - 'shacl/**/*.ttl' | |
| - 'examples/**/*.rdf' | |
| - 'examples/**/*.ttl' | |
| - '.github/workflows/validate-shacl.yml' | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - 'shacl/**/*.ttl' | |
| - 'examples/**/*.rdf' | |
| - 'examples/**/*.ttl' | |
| jobs: | |
| validate-dcat-ap-es: | |
| name: Validación formas SHACL DCAT-AP-ES (Todas las Fases) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Comprobar repositorio | |
| uses: actions/checkout@v5 | |
| - name: Ejecutar validación de formas SHACL DCAT-AP-ES | |
| id: validate | |
| continue-on-error: true | |
| run: | | |
| chmod +x tests/validate-local.sh | |
| ./tests/validate-local.sh all | |
| echo "exit_code=$?" >> $GITHUB_OUTPUT | |
| - name: Subir informes de validación | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dcat-ap-es-validation-reports | |
| path: tests/validation-reports/ | |
| retention-days: 30 | |
| - name: Commentar resumen de validación en el PR | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const summary = fs.readFileSync('tests/validation-reports/SUMMARY.md', 'utf8'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: summary | |
| }); | |
| - name: Comprobar resultado de la validación | |
| run: | | |
| EXIT_CODE="${{ steps.validate.outputs.exit_code }}" | |
| if [ "$EXIT_CODE" != "0" ]; then | |
| echo "❌ Validación fallida, revisa los artefactos con los informes. Código de salida: $EXIT_CODE" | |
| exit 1 | |
| fi | |
| echo "✅ Validación completada con éxito." |