Skip to content

Commit

Permalink
Check that stm32 code is up to date (#330)
Browse files Browse the repository at this point in the history
* Check that stm32 code is up to date

* Add working directory

* fix typo

* try building regz in release safe mode

* don't fail PR on check failure (might want to follow up with another PR)
  • Loading branch information
mattnite authored Dec 23, 2024
1 parent 43870f5 commit 18fecdc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,27 @@ jobs:
run: zig build -Doptimize=ReleaseSmall --summary all
working-directory: examples/${{ matrix.example_dir }}

stm32-gen-check:
name: Check that stm32 generated code is up to date
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ env.ZIG_VERSION }}
- name: Generate Code
run: zig build update
working-directory: port/stmicro/stm32
- name: Check for code diffs
run: |
if [[ $(git status --porcelain) ]]; then
echo "Code differences detected:"
git diff
echo "Please commit or fix these changes to proceed."
exit 1
else
echo "No code differences detected."
fi
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ pub fn MicroBuild(port_select: PortSelect) type {
cpu_mod.addImport("microzig", core_mod);
core_mod.addImport("cpu", cpu_mod);

const regz_exe = b.dependency("tools/regz", .{}).artifact("regz");
const regz_exe = b.dependency("tools/regz", .{ .optimize = .ReleaseSafe }).artifact("regz");
const chip_source = switch (target.chip.register_definition) {
.atdf, .svd => |file| blk: {
const regz_run = b.addRunArtifact(regz_exe);
Expand Down

0 comments on commit 18fecdc

Please sign in to comment.