Skip to content

Commit c8f8f7b

Browse files
committed
add extensions change check to ci
1 parent 3251a2e commit c8f8f7b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,30 @@ jobs:
278278
flags: python
279279
token: ${{ secrets.CODECOV_TOKEN }}
280280

281+
# Ensure that serialized extensions match rust implementation
282+
tket2-extensions:
283+
needs: [changes, tests-rs-stable-all-features]
284+
if: ${{ needs.changes.outputs.rust == 'true' && github.event_name != 'merge_group' }}
285+
name: Check standard extensions
286+
runs-on: ubuntu-latest
287+
steps:
288+
- uses: actions/checkout@v4
289+
- name: Generate the updated definitions
290+
run: just gen-extensions
291+
- name: Check if the declarations are up to date
292+
run: |
293+
git diff --exit-code --name-only tket2-py/tket2/extensions/_json_defs
294+
if [ $? -ne 0 ]; then
295+
echo "The serialized standard extensions are not up to date"
296+
echo "Please run 'just gen-extensions' and commit the changes"
297+
exit 1
298+
fi
299+
281300
# This is a meta job to mark successful completion of the required checks,
282301
# even if they are skipped due to no changes in the relevant files.
283302
required-checks:
284303
name: Required checks 🦀+🐍
285-
needs: [changes, check-rs, check-py, tests-rs-stable-no-features, tests-rs-stable-all-features, tests-py]
304+
needs: [changes, check-rs, check-py, tests-rs-stable-no-features, tests-rs-stable-all-features, tests-py, tket2-extensions]
286305
if: ${{ !cancelled() }}
287306
runs-on: ubuntu-latest
288307
steps:

0 commit comments

Comments
 (0)