Skip to content

Commit 0acc106

Browse files
authored
Add CI job to check auto-generated code is committed (#211)
Added a job to verify that auto-generated code is committed after making changes to a corresponding source of truth. This should prevent problems, like the recent atomic store instructions that were committed, but missing in `instructions.json` and vice versa.
1 parent 6dbf380 commit 0acc106

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ concurrency:
1010
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1111

1212
jobs:
13+
check-autogen-diff:
14+
runs-on: ubuntu-latest
15+
container:
16+
image: swift:6.2-noble
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Re-generate auto-generated code checks
20+
run: |
21+
swift run -q --package-path Utilities WasmKitDevUtils
22+
- name: Check for changes
23+
run: |
24+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
25+
git diff --exit-code || {
26+
echo "::error::The auto-generated code utilities changed some files. Please see \`Utilities/README.md\`, re-run the tools, and commit the changes."
27+
exit 1
28+
}
1329
build-macos:
1430
strategy:
1531
matrix:

0 commit comments

Comments
 (0)