Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate job jsonschema #357

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/generate-jsonschema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Generate JSON Schema

on:
workflow_dispatch:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
generate-jsonschemas:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel poetry

- name: Install prettier
run: npm install --global prettier

- name: Build and Install DataYoga Core
run: |
cd core
poetry build
pip install dist/*.whl

- name: Generate DataYoga Job Schema
run: |
python -c "import json; from datayoga_core.job import Job; schema = Job.get_json_schema(); open('schemas/job.schema.json', 'w').write(json.dumps(schema))"

- name: Prettify JSON Schema files
run: prettier --write "schemas/**/*.json"

- name: Push to repo
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git diff --cached --exit-code || git commit -m "update json schemas"
git push --force
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8",
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": true
"source.organizeImports": "explicit",
"source.fixAll": "explicit"
},
"editor.formatOnSaveMode": "file",
"editor.formatOnSave": true
Expand Down
Loading
Loading