diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c8f14b83..4bf33edf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,15 @@ jobs: run: python -m playwright install - name: Lint run: pre-commit run --all-files - - name: Test Sync generation script - run: bash scripts/verify_api.sh + - name: Generate APIs + run: bash scripts/update_api.sh + - name: Verify API is up to date + run: | + if [[ -n $(git status -s) ]]; then + echo "ERROR: generated code differ from the current sources:" + git diff + exit 1 + fi build: name: Build timeout-minutes: 30 diff --git a/scripts/verify_api.sh b/scripts/verify_api.sh deleted file mode 100755 index 565d14b9c..000000000 --- a/scripts/verify_api.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -function assert_script { - newfile="$2" - oldfile="playwright/$2" - echo "Testing $newfile against $oldfile" - - if ! python $1 > $newfile; then - exit 1 - fi - - pre-commit run --files $newfile - - cmp $oldfile $newfile - exit_code=$? - rm $newfile -} - -assert_script "scripts/generate_sync_api.py" "sync_api.py" -assert_script "scripts/generate_async_api.py" "async_api.py"