-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.54 KB
/
schema-gen.yml
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
42
43
44
45
46
47
48
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Schema Generation
on:
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
miniforge-version: latest
- name: Installing python dependencies
run: |
pip install datamodel-code-generator
pip install '.[dev]' # pytest primarily
shell: bash -l {0}
- name: Run datamodel-generation
shell: bash -l {0}
run: |
datamodel-codegen --input schemas --input-file-type jsonschema --output python_models --output-model pydantic_v2.BaseModel
PYTHONPATH=. pytest test/load_models.py
- name: Run openapi-generation for python
shell: bash -l {0}
run: |
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/openapi.json \
-g python \
-o /local/out/python
- name: Run openapi-generation for python
shell: bash -l {0}
run: |
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/openapi.json \
-g julia-server \
-o /local/out/julia