File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,11 +16,18 @@ jobs:
1616 uses : actions/setup-python@v5
1717 with :
1818 python-version : ' 3.11'
19+ - name : Checkout Test Harness
20+ uses : actions/checkout@v4
21+ with :
22+ repository : SamuelMarks/cdd-openapi-test-harness
23+ path : cdd-openapi-test-harness
1924 - name : Install dependencies
2025 run : |
2126 pip install uv
2227 make install_deps
2328 - name : Run pre-commit hooks
29+ env :
30+ TEST_HARNESS_DIR : ${{ github.workspace }}/cdd-openapi-test-harness
2431 run : |
2532 uv tool install pre-commit --with pre-commit-uv
2633 pre-commit run --all-files
Original file line number Diff line number Diff line change @@ -170,3 +170,7 @@ celerybeat.pid
170170/fix_ * .py
171171
172172/test_pydantic_v1.py
173+
174+ # Pre-commit test directories
175+ .tmp_swagger /
176+ .tmp_oas3 /
Original file line number Diff line number Diff line change 11repos :
2- - repo : https://github.com/pre-commit/pre-commit-hooks
3- rev : v4.5.0
4- hooks :
5- - id : trailing-whitespace
6- - id : check-yaml
7- - id : check-added-large-files
8- - repo : https://github.com/astral-sh/ruff-pre-commit
9- rev : v0.4.4
10- hooks :
11- - id : ruff
12- args : [ --fix ]
13- - id : ruff-format
14- - repo : local
15- hooks :
16- - id : build
17- name : Build
18- entry : uv build
19- language : system
20- pass_filenames : false
21- always_run : true
22- - id : test-and-coverage-badges
23- name : Run Tests and Update Coverage Badges
24- entry : uv run python scripts/update_badges.py
25- language : system
26- pass_filenames : false
27- always_run : true
2+ - repo : https://github.com/pre-commit/pre-commit-hooks
3+ rev : v4.5.0
4+ hooks :
5+ - id : trailing-whitespace
6+ - id : check-yaml
7+ - id : check-added-large-files
8+ - repo : https://github.com/astral-sh/ruff-pre-commit
9+ rev : v0.4.4
10+ hooks :
11+ - id : ruff
12+ args :
13+ - --fix
14+ - id : ruff-format
15+ - repo : local
16+ hooks :
17+ - id : build
18+ name : Build
19+ entry : uv build
20+ language : system
21+ pass_filenames : false
22+ always_run : true
23+ - id : test-and-coverage-badges
24+ name : Run Tests and Update Coverage Badges
25+ entry : uv run python scripts/update_badges.py
26+ language : system
27+ pass_filenames : false
28+ always_run : true
29+ - id : swagger-2-0-petstore
30+ name : Swagger 2.0 Petstore Test
31+ entry : bash -c "TEST_HARNESS=${TEST_HARNESS_DIR:-/Users/samuel/repos/cdd-openapi-test-harness};
32+ uv run cdd-python from_openapi to_sdk_cli -i $TEST_HARNESS/petstore.json -o
33+ .tmp_swagger && rm -rf .tmp_swagger"
34+ language : system
35+ pass_filenames : false
36+ always_run : true
37+ - id : openapi-3-2-0-petstore
38+ name : OpenAPI 3.2.0 Petstore Test
39+ entry : bash -c "TEST_HARNESS=${TEST_HARNESS_DIR:-/Users/samuel/repos/cdd-openapi-test-harness};
40+ uv run cdd-python from_openapi to_sdk_cli -i $TEST_HARNESS/petstore_oas3.json
41+ -o .tmp_oas3 && rm -rf .tmp_oas3"
42+ language : system
43+ pass_filenames : false
44+ always_run : true
45+ - id : build-wasm
46+ name : Build WASM
47+ entry : make build_wasm
48+ language : system
49+ pass_filenames : false
50+ always_run : true
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ cdd-python-all
22==============
33[ ![ License] ( https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg )] ( https://opensource.org/licenses/Apache-2.0 )
44[ ![ CI] ( https://github.com/offscale/cdd-python-all/actions/workflows/ci.yml/badge.svg )] ( https://github.com/offscale/cdd-python-all/actions )
5- [ ![ Test Coverage] ( https://img.shields.io/badge/test_coverage-100 %25-brightgreen.svg )] ( # )
6- [ ![ Doc Coverage] ( https://img.shields.io/badge/doc_coverage-100 %25-brightgreen.svg )] ( # )
5+ [ ![ Test Coverage] ( https://img.shields.io/badge/test_coverage-99 %25-brightgreen.svg )] ( # )
6+ [ ![ Doc Coverage] ( https://img.shields.io/badge/doc_coverage-99 %25-brightgreen.svg )] ( # )
77
88----
99
Original file line number Diff line number Diff line change @@ -15,11 +15,24 @@ echo "[pre-commit] Checking linting..."
1515uv run ruff check .
1616
1717echo " [pre-commit] Building project..."
18- uv run python -m build
18+ uv build
1919
20- echo " [pre-commit] Calculating coverage and updating badges..."
20+ echo " [pre-commit] Running tests and updating badges..."
2121uv run python scripts/update_badges.py
2222
23+ TEST_HARNESS=${TEST_HARNESS_DIR:-/ Users/ samuel/ repos/ cdd-openapi-test-harness}
24+
25+ echo " [pre-commit] Running Swagger 2.0 Petstore test..."
26+ uv run cdd-python from_openapi to_sdk_cli -i " $TEST_HARNESS /petstore.json" -o .tmp_swagger
27+ rm -rf .tmp_swagger
28+
29+ echo " [pre-commit] Running OpenAPI 3.2.0 Petstore test..."
30+ uv run cdd-python from_openapi to_sdk_cli -i " $TEST_HARNESS /petstore_oas3.json" -o .tmp_oas3
31+ rm -rf .tmp_oas3
32+
33+ echo " [pre-commit] Building WASM..."
34+ make build_wasm
35+
2336if git diff --name-only | grep -q " README.md" ; then
2437 echo " [pre-commit] README.md was updated with new coverage badges. Staging changes..."
2538 git add README.md
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class OpenAPIBase(BaseModel):
1515 populate_by_name = True ,
1616 )
1717 else :
18+
1819 class Config :
1920 extra = "allow"
2021 allow_population_by_field_name = True
You can’t perform that action at this time.
0 commit comments