[bazel][ci] Add CI action to generate pregen patch (#8816)

There were complaints about no patch files being created from CI when
the examples pre-gen fails for people who don't build with bazel. This
adds a new action step to run just the non-robotpy pregen.

I also added an argument to the diff tests to make it a unified diff,
which might make it easier to hand fix.
This commit is contained in:
PJ Reiniger
2026-04-25 14:06:02 -04:00
committed by GitHub
parent 2edef821f9
commit e7e51c9c05
15 changed files with 44 additions and 0 deletions

View File

@@ -136,6 +136,35 @@ jobs:
path: "*-bazel-lint-fixes.patch"
if: ${{ failure() }}
non_robotpy_pregeneration:
name: "Non-RobotPy Pregen"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with: { fetch-depth: 0 }
- id: Setup_bazel_remote
uses: ./.github/actions/setup-bazel-remote
with:
username: ${{ secrets.BAZEL_CACHE_USERNAME }}
password: ${{ secrets.BAZEL_CACHE_PASSWORD }}
- name: Run Non-RobotPy pregeneration
run: bazel run //:write_pregenerated_files
- name: Check Output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > non-robotpy-pregeneration.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v6
with:
name: non-robotpy-pregeneration-fixes
path: non-robotpy-pregeneration.patch
if: ${{ failure() }}
robotpy_pregeneration:
name: "Robotpy Pregeneration"
runs-on: ubuntu-24.04