Forge: resume failed runs from continuation markers #5455
Workflow file for this run
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
| # Per-PR gate that validates and sorts metadata/library-and-framework-list.json against its schema. | |
| # §CI-library-and-framework-list-validation; the master list is part of §METADATA-suite. | |
| name: "Validate library-and-framework-list.json" | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate-library-and-framework-list-json: | |
| name: "📋 Validate the JSON file" | |
| runs-on: "ubuntu-22.04" | |
| timeout-minutes: 5 | |
| steps: | |
| - name: "☁️ Checkout repository" | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: "🔎 Detect relevant file changes" | |
| id: filter | |
| uses: ./.github/actions/detect-file-changes | |
| with: | |
| file-patterns: | | |
| - 'metadata/library-and-framework-list.json' | |
| - 'metadata/schemas/library-and-framework-list-schema*.json' | |
| - uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 | |
| with: | |
| python-version: '3.10' | |
| if: steps.filter.outputs.changed == 'true' | |
| - name: Check that the JSON file is well-formatted and sorted by artifact | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| JSON="metadata/library-and-framework-list.json" | |
| if ! jq -e . "${JSON}" >/dev/null; then | |
| echo "'${JSON}' fails to parse. Please make sure it is a valid JSON file." | |
| exit 6 | |
| fi | |
| DIFF=$(diff "${JSON}" <(jq -s '.[] | sort_by(.artifact)' "${JSON}")) | |
| if [[ -n "${DIFF}" ]]; then | |
| echo "'${JSON}' is no longer sorted by artifact key. You can use 'jq' to sort it: 'sorted="$(jq -s '.[] | sort_by(.artifact)' ${JSON})" && echo -E "${sorted}" > ${JSON}" | |
| exit 8 | |
| fi | |
| - name: Check that the JSON file conforms to the schema | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| pip install check-jsonschema | |
| check-jsonschema --schemafile metadata/schemas/library-and-framework-list-schema-v1.0.0.json metadata/library-and-framework-list.json |