From c8f8f7b55bf1d19974c9477700ffe5cfcef923d8 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Wed, 4 Sep 2024 14:59:30 +0100 Subject: [PATCH] add extensions change check to ci --- .github/workflows/ci.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6745667c..5a907dd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -278,11 +278,30 @@ jobs: flags: python token: ${{ secrets.CODECOV_TOKEN }} + # Ensure that serialized extensions match rust implementation + tket2-extensions: + needs: [changes, tests-rs-stable-all-features] + if: ${{ needs.changes.outputs.rust == 'true' && github.event_name != 'merge_group' }} + name: Check standard extensions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Generate the updated definitions + run: just gen-extensions + - name: Check if the declarations are up to date + run: | + git diff --exit-code --name-only tket2-py/tket2/extensions/_json_defs + if [ $? -ne 0 ]; then + echo "The serialized standard extensions are not up to date" + echo "Please run 'just gen-extensions' and commit the changes" + exit 1 + fi + # This is a meta job to mark successful completion of the required checks, # even if they are skipped due to no changes in the relevant files. required-checks: name: Required checks 🦀+🐍 - needs: [changes, check-rs, check-py, tests-rs-stable-no-features, tests-rs-stable-all-features, tests-py] + needs: [changes, check-rs, check-py, tests-rs-stable-no-features, tests-rs-stable-all-features, tests-py, tket2-extensions] if: ${{ !cancelled() }} runs-on: ubuntu-latest steps: