Skip to content

Commit

Permalink
Merge pull request #206 from kieler/mka/type-generation-action
Browse files Browse the repository at this point in the history
Create build-types.yml action to test whether modified schema file can generate pydantic types correctly
  • Loading branch information
Eddykasp authored Nov 15, 2024
2 parents b91c16d + 470f3d8 commit 2948d5a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test Type Generation from Schemas

on:
pull_request:
paths:
- schema/

jobs:
build-pydantic:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
id: checkout_repository
uses: actions/checkout@v4
with:
sparse-checkout: schema
fetch-depth: 1
- name: Install datamodel-code-generator
id: install_code_generator
run: |
python -m venv ls-env
source ls-env/bin/activate
pip install datamodel-code-generator
- name: Generate Pydantic types
id: generate_pydantic_types
run: |
source ls-env/bin/activate
datamodel-codegen --input schema/ --input-file-type jsonschema --output GEN/ --use-default

0 comments on commit 2948d5a

Please sign in to comment.