Files
bottom/.github/workflows/validate_schema.yml
Clement Tsang 40254c24e0 other: fix schema crate interfering with installs (#2109)
This change should fix the issue around `cargo install` being confused by the schema generation binary by just moving it entirely into a separate tool "crate".
2026-06-27 17:44:44 -04:00

64 lines
2.1 KiB
YAML

# Workflow to validate the latest schema.
name: "validate schema"
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
paths:
- "schema/**"
- "scripts/schema/**"
- "tools/schema_gen/**"
- ".github/workflows/validate_schema.yml"
- "Cargo.toml"
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'ClementTsang/bottom' }}
jobs:
pre-job:
runs-on: ubuntu-24.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: ClementTsang/skip-duplicate-actions@41b0a75f656d455934ffa6a46b779d8d996ac47c
with:
skip_after_successful_duplicate: "true"
paths: '["schema/**", "scripts/schema/**", ".github/workflows/validate_schema.yml", ".github/ci", "tools/schema_gen/**", "Cargo.toml"]'
do_not_skip: '["workflow_dispatch"]'
test-build-documentation:
name: Test validating schema
needs: pre-job
if: ${{ needs.pre-job.outputs.should_skip != 'true' }}
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.12
- name: Install Python dependencies
run: pip install -r scripts/schema/requirements.txt
- name: Test nightly validates on valid sample configs
run: |
python3 scripts/schema/validator.py -s ./schema/nightly/bottom.json -f ./sample_configs/default_config.toml
python3 scripts/schema/validator.py --uncomment -s ./schema/nightly/bottom.json -f ./sample_configs/default_config.toml
python3 scripts/schema/validator.py -s ./schema/nightly/bottom.json -f ./sample_configs/demo_config.toml
- name: Test nightly catches on a bad sample config
run: |
python3 scripts/schema/validator.py -s ./schema/nightly/bottom.json -f scripts/schema/bad_file.toml --should_fail