Files
synapse/.github/workflows/schema.yaml
T
Eric Eastwood 1b0fd0abc6 Pin Python versions in CI (#20531)
Part of https://github.com/element-hq/backend-internal/issues/238

Also discussed in [meeting to improve security release
process](https://docs.google.com/document/d/1UUShIXcuhmDX53-auQIEkeuEaLDYedkFfiE6NbSzOuE/edit?tab=t.0#bookmark=id.c2cmusfqw6lc)

Spawning from seeing the CI failing in an old LTS branch because it's
choosing the newest Python 3.15 which we're not compatible with yet
(https://github.com/element-hq/synapse/issues/20340), let alone the old
LTS. We also experienced this here in Synapse FOSS codebase which is why
https://github.com/element-hq/synapse/pull/20386 was made.
2026-11-18 17:14:21 -06:00

61 lines
2.1 KiB
YAML

name: Schema
on:
pull_request:
paths:
- schema/**
- docs/usage/configuration/config_documentation.md
push:
branches: ["develop", "release-*"]
workflow_dispatch:
env:
LATEST_SUPPORTED_PYTHON_VERSION: "3.14"
jobs:
validate-schema:
name: Ensure Synapse config schema is valid
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
- name: Install check-jsonschema
run: pip install check-jsonschema==0.33.0
- name: Validate meta schema
run: check-jsonschema --check-metaschema schema/v*/meta.schema.json
- name: Validate schema
run: |-
# Please bump on introduction of a new meta schema.
LATEST_META_SCHEMA_VERSION=v1
check-jsonschema \
--schemafile="schema/$LATEST_META_SCHEMA_VERSION/meta.schema.json" \
schema/synapse-config.schema.yaml
- name: Validate default config
# Populates the empty instance with default values and checks against the schema.
run: |-
echo "{}" | check-jsonschema \
--fill-defaults --schemafile=schema/synapse-config.schema.yaml -
check-doc-generation:
name: Ensure generated documentation is up-to-date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
- name: Install PyYAML
run: pip install PyYAML==6.0.2
- name: Regenerate config documentation
run: |
scripts-dev/gen_config_documentation.py \
schema/synapse-config.schema.yaml \
> docs/usage/configuration/config_documentation.md
- name: Error in case of any differences
# Errors if there are now any modified files (untracked files are ignored).
run: "git diff --exit-code"