Generate JSON Schema #4
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: Generate JSON Schema | |
on: | |
push: | |
branches: ['master'] | |
paths: | |
- 'traiNNer/utils/redux_options.py' # Only trigger if this file is changed | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
generate_schema: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code from the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Set up Python environment | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
# Install dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[dev] | |
# Generate the JSON schema | |
- name: Generate JSON Schema | |
run: | | |
python scripts/options/generate_schema.py | |
# Commit and push the generated schema to the repository | |
- name: Commit and push generated schema | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: 'the-database' | |
author_email: '25811902+the-database@users.noreply.github.com' | |
message: 'Update generated JSON schema' | |
token: ${{ secrets.GH_USER_TOKEN }} # Use your personal access token |