Skip to content

Commit 12e8f92

Browse files
authored
ci: Stop auto-committing changes as it doesn't work in external PRs (#567)
1 parent 5de5920 commit 12e8f92

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

.github/check_for_changes.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import subprocess
2+
3+
output = subprocess.run(["git", "status", "--porcelain"], capture_output=True, check=True).stdout
4+
5+
if output == b"":
6+
# No changes
7+
exit(0)
8+
9+
print(output)
10+
exit(1)

.github/workflows/checks.yml

+3-13
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ 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-
6764
- name: Run pytest
6865
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
6966
env:
@@ -77,18 +74,12 @@ jobs:
7774
with:
7875
files: ./coverage.xml
7976

80-
- uses: stefanzweifel/git-auto-commit-action@v4
81-
if: runner.os == 'Linux'
82-
with:
83-
commit_message: "chore: Regenerate E2E Golden Record"
84-
file_pattern: end_to_end_tests/golden-record end_to_end_tests/custom-templates-golden-record
85-
8677
integration:
8778
name: Integration Tests
8879
runs-on: ubuntu-latest
8980
services:
9081
openapi-test-server:
91-
image: ghcr.io/openapi-generators/openapi-test-server:latest
82+
image: ghcr.io/openapi-generators/openapi-test-server:0.0.1
9283
ports:
9384
- "3000:3000"
9485
steps:
@@ -116,6 +107,8 @@ jobs:
116107
- name: Regenerate Integration Client
117108
run: |
118109
poetry run openapi-python-client update --url http://localhost:3000/openapi.json --config integration-tests-config.yaml
110+
- name: Check for any file changes
111+
run: python .github/check_for_changes.py
119112
- name: Cache Generated Client Dependencies
120113
uses: actions/cache@v2
121114
with:
@@ -133,6 +126,3 @@ jobs:
133126
run: |
134127
cd integration-tests
135128
poetry run pytest
136-
- uses: stefanzweifel/git-auto-commit-action@v4
137-
with:
138-
commit_message: "chore: Regenerate Integration Client"

integration-tests/tests/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from integration_tests.client import Client
34

45

integration-tests/tests/test_api/test_parameters/test_post_parameters_header.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test(client: Client) -> None:
1818
)
1919

2020
parsed = response.parsed
21-
assert parsed is not None, f"{response.status_code}: {response.content}"
21+
assert parsed is not None, f"{response.status_code}: {response.content!r}"
2222
assert isinstance(
2323
parsed,
2424
PostParametersHeaderResponse200,

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ exclude = '''
101101
[tool.isort]
102102
line_length = 120
103103
profile = "black"
104-
skip = [".venv", "tests/test_templates"]
104+
skip = [".venv", "tests/test_templates", "integration-tests"]
105105

106106
[tool.coverage.run]
107107
omit = ["openapi_python_client/templates/*"]

0 commit comments

Comments
 (0)