From 82c573f0a5df4a1d042d89053fd2629476769cec Mon Sep 17 00:00:00 2001 From: hakril Date: Thu, 12 Nov 2026 13:51:49 +0100 Subject: [PATCH] CI now check that windows/generated_def/ match ctypes_generation results --- .github/workflows/tests.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bcc801f1..6f4eff32 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,12 +14,25 @@ jobs: runs-on: windows-latest timeout-minutes: 5 steps: + # Generated files are written with CRLF on Windows: autocrlf makes git compare them + # to the committed versions without EOL noise (explicit, to not rely on the runner default) + - run: git config --global core.autocrlf true - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.11' - - run: - py .\ctypes_generation\generate.py + # Delete generated files before regenerating: allow to detect all mismatches between generation & committed files + - name: Generate code + shell: bash + run: | + find windows/generated_def -type f ! -name __init__.py -delete + rm docs/source/*_generated.rst + py ctypes_generation/generate.py + - name: Check generated code matches the committed one + shell: bash + run: | + git add --all windows/generated_def docs/source + git diff --cached --exit-code - name: Check generated code can execute run: py -c "import windows.generated_def" tests: