agama/.github/workflows/ci-profile-schema.yml
Ladislav Slezák 1df60385d5
Fix the JSON schema and validate it in CI (#2635)
## Problem

- The JSON schema definition contains several issues, some JSON
validators might refuse to use it.

## Solution

- Fix the problems reported by the [Ajv](https://ajv.js.org/) JSON
schema validator
- Added a CI job for validating the schema definition automatically

## Testing

- Added a new CI test
- [Example CI
run](https://github.com/agama-project/agama/actions/runs/16715340116/job/47307606303#step:5:9)
2025-08-04 12:35:34 +02:00

56 lines
1.4 KiB
YAML

name: CI - Profile schema
permissions:
contents: read
on:
push:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used below for the pull request event. Keep both lists in sync!!
# this file as well
- .github/workflows/ci-profile-schema.yml
# any change in the schema definitions
- rust/agama-lib/share/*.schema.json
pull_request:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used above for the push event. Keep both lists in sync!!
# this file as well
- .github/workflows/ci-profile-schema.yml
# any change in the schema definitions
- rust/agama-lib/share/*.schema.json
# allow running manually
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
# checkout only the directory with the schema
sparse-checkout: |
rust/agama-lib/share
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 22
cache: npm
cache-dependency-path: rust/agama-lib/share
- name: Install Node Packages
run: npm ci
working-directory: rust/agama-lib/share
- name: Validate the schema
run: npm run validate
working-directory: rust/agama-lib/share