From 90019e88e74574643d255a0ac8c33946fe888524 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Sat, 6 Feb 2021 11:55:18 +0100 Subject: [PATCH] chore: fix broken script to detect API diff on bots --- .github/workflows/ci.yml | 11 +++++++++-- scripts/verify_api.sh | 20 -------------------- 2 files changed, 9 insertions(+), 22 deletions(-) delete mode 100755 scripts/verify_api.sh 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"