From ce4b47c5a536760dc23b918757e5632ac14ef206 Mon Sep 17 00:00:00 2001 From: 143672 Date: Tue, 2 Dec 2025 17:32:57 +0400 Subject: [PATCH] Add CI job to verify generated code is up-to-date --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88484587..15711985 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,4 +128,55 @@ jobs: # cargo wasi build --features cryptographically-insecure # #cargo wasi test -- --nocapture + generated-code-is-up-to-date: + runs-on: ubuntu-latest + + env: + PIPENV_VENV_IN_PROJECT: 1 + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + cache: 'pip' + + - name: Restore Pipenv virtualenv cache + uses: actions/cache@v4 + with: + path: .venv + key: pipenv-venv-${{ runner.os }}-${{ hashFiles('Pipfile.lock') }} + restore-keys: | + pipenv-venv-${{ runner.os }}- + + - name: Install Pipenv + run: pip install --upgrade pipenv + + - name: Install dependencies (Pipfile.lock) + run: pipenv sync --dev + + - name: Regenerate all crates + run: pipenv run python generate-implementations.py + + - name: Check for uncommitted changes + run: | + if ! git diff --exit-code --quiet; then + echo "❌ ERROR: Generated files are out of date!" + git diff --name-only + git diff --color + exit 1 + fi + + if ! git diff --cached --exit-code --quiet; then + echo "❌ ERROR: Staged changes detected!" + git diff --cached --name-only + git diff --cached --color + exit 1 + fi + + echo "✅ All generated files are up-to-date!" # vim: set ft=yaml ts=2 sw=2 tw=0 et :