diff --git a/.github/workflows/build-types.yml b/.github/workflows/build-types.yml new file mode 100644 index 00000000..023a5945 --- /dev/null +++ b/.github/workflows/build-types.yml @@ -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