-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.16 KB
/
schema-validation.yml
File metadata and controls
41 lines (37 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: OpenAPI schema validation
on:
workflow_dispatch:
pull_request:
paths:
- 'backend/**'
- '.github/workflows/schema-validation.yml'
permissions:
contents: read
jobs:
validate-schema:
name: OpenAPI schema validation
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
env:
DJANGO_SETTINGS_MODULE: core.settings.ci
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Poetry
run: pipx install poetry
- name: Install dyff
run: curl --silent --location https://git.io/JYfAY | sudo bash
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: 3.14
cache: 'poetry'
cache-dependency-path: backend/poetry.lock
- name: Install dependencies
run: poetry install --without=debug,test
- name: Generate schema from code
run: poetry run python manage.py spectacular --file schema.new.yaml --validate --fail-on-warn
- name: Compare version controlled schema file with newly generated one
run: dyff between schema.yaml schema.new.yaml --set-exit-code