Skip to content

Commit 62e23bc

Browse files
committed
ci: Auto-commit back changes to E2E / integration clients
1 parent 0747bb7 commit 62e23bc

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/checks.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
- name: Run pylint
6262
run: poetry run pylint openapi_python_client
6363

64+
- name: Regenerate Golden Record
65+
run: poetry run task regen_e2e
66+
6467
- name: Run pytest
6568
run: poetry run pytest --cov=openapi_python_client --cov-report=term-missing tests end_to_end_tests/test_end_to_end.py --basetemp=tests/tmp
6669
env:
@@ -74,6 +77,10 @@ jobs:
7477
with:
7578
files: ./coverage.xml
7679

80+
- uses: stefanzweifel/git-auto-commit-action@v4
81+
with:
82+
commit_message: "chore: Regenerate E2E Golden Record"
83+
7784
integration:
7885
name: Integration Tests
7986
runs-on: ubuntu-latest
@@ -108,8 +115,6 @@ jobs:
108115
run: |
109116
cd integration_tests
110117
poetry run openapi-python-client update --url http://localhost:3000/openapi.json
111-
- name: Check if there are changes to the client
112-
run: changed_files=$(git status --porcelain | wc -l) && [ changed_files != 0 ] && exit 1
113118
- name: Cache Generated Client Dependencies
114119
uses: actions/cache@v2
115120
with:
@@ -127,3 +132,6 @@ jobs:
127132
run: |
128133
cd integration_tests/openapi-test-server-client
129134
poetry run pytest
135+
- uses: stefanzweifel/git-auto-commit-action@v4
136+
with:
137+
commit_message: "chore: Regenerate Integration Client"

pyproject.toml

+8-4
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,20 @@ isort .\
6666
&& rm -r tests/tmp\
6767
"""
6868
regen = """
69-
python -m end_to_end_tests.regen_golden_record\
70-
&& pushd integration_tests\
71-
&& openapi-python-client update --url https://raw.githubusercontent.com/openapi-generators/openapi-test-server/main/openapi.json\
72-
&& popd
69+
task regen_e2e\
70+
&& task regen_integration\
7371
"""
7472
e2e = "pytest openapi_python_client end_to_end_tests/test_end_to_end.py"
7573
re = """
7674
task regen\
7775
&& task e2e\
7876
"""
77+
regen_e2e = "python -m end_to_end_tests.regen_golden_record"
78+
regen_integration = """
79+
pushd integration_tests\
80+
&& openapi-python-client update --url https://raw.githubusercontent.com/openapi-generators/openapi-test-server/main/openapi.json\
81+
&& popd
82+
"""
7983
docs = "typer openapi_python_client/cli.py utils docs > usage.md"
8084

8185
[tool.black]

0 commit comments

Comments
 (0)