pw_presubmit: Add substeps to stm32f429i presubmits

Bug: b/253021172
Change-Id: I34062a2fcf5f3e4d71652a6d538068254de6ffef
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/126006
Reviewed-by: Keir Mierle <keir@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
index fc13943..495bcd8 100755
--- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
+++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
@@ -186,15 +186,21 @@
     build.ninja(ctx, *_at_all_optimization_levels('stm32f429i'))
 
 
-@_BUILD_FILE_FILTER.apply_to_check()
-def stm32f429i(ctx: PresubmitContext):
-    build.gn_gen(
-        ctx,
-        pw_use_test_server=True,
-        pw_C_OPTIMIZATION_LEVELS=_OPTIMIZATION_LEVELS,
-    )
-    with build.test_server('stm32f429i_disc1_test_server', ctx.output_dir):
-        build.ninja(ctx, *_at_all_optimization_levels('stm32f429i'))
+stm32f429i = build.GnGenNinja(
+    name='stm32f429i',
+    path_filter=_BUILD_FILE_FILTER,
+    gn_args={
+        'pw_use_test_server': True,
+        'pw_C_OPTIMIZATION_LEVELS': _OPTIMIZATION_LEVELS,
+    },
+    ninja_contexts=(
+        lambda ctx: build.test_server(
+            'stm32f429i_disc1_test_server',
+            ctx.output_dir,
+        ),
+    ),
+    ninja_targets=_at_all_optimization_levels('stm32f429i'),
+)
 
 
 gn_nanopb_build = build.GnGenNinja(