Create build-types.yml #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Type Generation from Schemas | |
on: | |
pull_request: | |
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 |