Add References section and RFC 9457 problem details for server errors #16
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: Test JSON Schema and Generate Diagram Images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| test_and_generate_images: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Install dependencies | |
| run: | | |
| npm install ajv-cli ajv-formats | |
| - name: Validate VDP examples against schema | |
| run: | | |
| npx ajv-cli test --spec=draft2020 -s vdp.v0-1.schema.json -d 'examples/vdp-*.json' --valid -c ajv-formats | |
| - name: Validate VDP discovery examples against schema | |
| run: | | |
| npx ajv-cli test --spec=draft2020 -s vdp-discovery.v0-1.schema.json -d 'examples/discovery-*.json' --valid -c ajv-formats | |
| - name: Validate RVST examples against schemas | |
| run: | | |
| for schema in $(find schemas -name '*.schema.json'); do | |
| for example in $(find examples -name 'example-*.json'); do | |
| echo "Validating $example against $schema" | |
| npx ajv-cli test -s $schema -d $example --valid -c ajv-formats || exit 1 | |
| done | |
| done | |
| - name: Generate diagram images | |
| run: | | |
| curl -fsSL https://d2lang.com/install.sh | sh -s -- | |
| export PATH="$HOME/.local/bin:$PATH" | |
| for diagram in $(find docs/diagrams -name '*.d2'); do | |
| echo "Generating image for $diagram" | |
| d2 "$diagram" "$(dirname "$diagram")/../images/$(basename "$diagram" .d2).svg" | |
| done | |
| - name: Commit and push generated images | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: | | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email 'actions@users.noreply.github.com' | |
| git add docs/images/* | |
| git commit -m "Generated diagram images" || echo "No changes to commit" | |
| git push |