593b94c120
pytest / Unit Tests (push) Has been cancelled
pytest / Integration (integration_tests_a) (push) Has been cancelled
pytest / Integration (integration_tests_b) (push) Has been cancelled
pytest / Integration (integration_tests_c) (push) Has been cancelled
pytest / Integration (integration_tests_d) (push) Has been cancelled
pytest / Integration (integration_tests_e) (push) Has been cancelled
pytest / Integration (integration_tests_f) (push) Has been cancelled
pytest / Integration (integration_tests_g) (push) Has been cancelled
pytest / Integration (integration_tests_h) (push) Has been cancelled
pytest / Integration (integration_tests_i) (push) Has been cancelled
pytest / Integration (integration_tests_j) (push) Has been cancelled
pytest / Distributed (distributed_a) (push) Has been cancelled
pytest / Distributed (distributed_b) (push) Has been cancelled
pytest / Distributed (distributed_c) (push) Has been cancelled
pytest / Distributed (distributed_d) (push) Has been cancelled
pytest / Distributed (distributed_e) (push) Has been cancelled
pytest / Distributed (distributed_f) (push) Has been cancelled
pytest / Minimal Install (push) Has been cancelled
pytest / Event File (push) Has been cancelled
pytest (slow) / py-slow (push) Has been cancelled
Publish JSON Schema / publish-schema (push) Has been cancelled
74 lines
2.5 KiB
YAML
74 lines
2.5 KiB
YAML
name: Publish JSON Schema
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "ludwig/schema/**"
|
|
- "ludwig/config_validation/**"
|
|
- "ludwig/constants.py"
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
publish-schema:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install Ludwig
|
|
run: pip install -e ".[test]"
|
|
|
|
- name: Export schemas
|
|
run: |
|
|
mkdir -p schema-out
|
|
ludwig export_schema --model-type combined -o schema-out/ludwig-config.json
|
|
ludwig export_schema --model-type ecd -o schema-out/ludwig-config-ecd.json
|
|
ludwig export_schema --model-type llm -o schema-out/ludwig-config-llm.json
|
|
|
|
- name: Generate index.html
|
|
run: |
|
|
cat > schema-out/index.html << 'HTMLEOF'
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Ludwig JSON Schema</title>
|
|
<style>body{font-family:system-ui,sans-serif;max-width:640px;margin:2rem auto;padding:0 1rem}a{color:#0066cc}</style>
|
|
</head>
|
|
<body>
|
|
<h1>Ludwig JSON Schema</h1>
|
|
<p>JSON Schema files for <a href="https://github.com/ludwig-ai/ludwig">Ludwig</a> config validation and IDE auto-complete.</p>
|
|
<ul>
|
|
<li><a href="ludwig-config.json">ludwig-config.json</a> — Combined (ECD + LLM)</li>
|
|
<li><a href="ludwig-config-ecd.json">ludwig-config-ecd.json</a> — ECD only</li>
|
|
<li><a href="ludwig-config-llm.json">ludwig-config-llm.json</a> — LLM only</li>
|
|
</ul>
|
|
<h2>Usage</h2>
|
|
<p>Add to your Ludwig YAML config:</p>
|
|
<pre># yaml-language-server: $schema=https://ludwig-ai.github.io/schema/ludwig-config.json</pre>
|
|
<p>Or see <a href="https://www.schemastore.org/json/">SchemaStore</a> for automatic IDE integration.</p>
|
|
</body>
|
|
</html>
|
|
HTMLEOF
|
|
|
|
- name: Publish to ludwig-ai/schema
|
|
uses: cpina/github-action-push-to-another-repository@v1.7.2
|
|
env:
|
|
SSH_DEPLOY_KEY: ${{ secrets.SCHEMA_REPO_DEPLOY_KEY }}
|
|
with:
|
|
source-directory: schema-out
|
|
destination-github-username: ludwig-ai
|
|
destination-repository-name: schema
|
|
target-branch: main
|
|
commit-message: "Update Ludwig JSON schema from ${{ github.sha }}"
|