Skip to content

Commit 166e94a

Browse files
trigger action on pull request (#123)
* fix branch name * fix schema generation * try to fix * Update optimizer_config.schema.json * change to test * add schema to make * change to python back --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 465e325 commit 166e94a

File tree

4 files changed

+49
-52
lines changed

4 files changed

+49
-52
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Check JSON Schema
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
generate-schema:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.10'
20+
21+
- name: Install dependencies
22+
run: |
23+
pip install .
24+
25+
- name: Generate JSON Schema
26+
run: |
27+
python -m scripts.generate_json_schema_config
28+
29+
- name: Check for changes in JSON Schema
30+
run: |
31+
if ! git diff --quiet docs/optimizer_config.schema.json; then
32+
echo "Error: docs/optimizer_config.schema.json has been modified after running the generator script."
33+
exit 1
34+
else
35+
echo "No changes detected in docs/optimizer_config.schema.json."
36+
fi

.github/workflows/generate-schema.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,9 @@ clean-docs:
4848
rm -rf docs/source/autoapi
4949
rm -rf docs/source/user_guides
5050

51+
.PHONY: schema
52+
schema:
53+
$(poetry) python -m scripts.generate_json_schema_config
54+
5155
.PHONY: all
5256
all: lint

docs/optimizer_config.schema.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,24 +441,26 @@
441441
"title": "Module Name",
442442
"type": "string"
443443
},
444-
"cv": {
444+
"embedder_name": {
445445
"items": {
446-
"type": "integer"
446+
"type": "string"
447447
},
448-
"title": "Cv",
448+
"title": "Embedder Name",
449449
"type": "array"
450450
},
451-
"embedder_name": {
451+
"cv": {
452+
"default": [
453+
3
454+
],
452455
"items": {
453-
"type": "string"
456+
"type": "integer"
454457
},
455-
"title": "Embedder Name",
458+
"title": "Cv",
456459
"type": "array"
457460
}
458461
},
459462
"required": [
460463
"module_name",
461-
"cv",
462464
"embedder_name"
463465
],
464466
"title": "LogregAimedEmbeddingInitModel",

0 commit comments

Comments
 (0)