Skip to content

Add Bazel CI workflow and buildifier formatting#459

Open
DominikAFischer wants to merge 8 commits into
eclipse-openbsw:mainfrom
esrlabs:cr-532643
Open

Add Bazel CI workflow and buildifier formatting#459
DominikAFischer wants to merge 8 commits into
eclipse-openbsw:mainfrom
esrlabs:cr-532643

Conversation

@DominikAFischer
Copy link
Copy Markdown
Contributor

@DominikAFischer DominikAFischer commented May 19, 2026

ℹ️ NOTE: The bulk of the changes made by this PR is the automatically generated Bazel lockfile: +2615 / -1

Add Bazel CI workflow and buildifier formatting:

  • Add bazel github action workflow, which currently contains these checks:
    • Smoke test: bazel version
    • Stale lockfile check: bazel mod deps --lockfile_mode=error
    • Bazel format check: bazel run //:format_check
    • Query all bazel targets: bazel query //...
    • Build all targets for host platform: bazel build //...
    • Build all targets for example embedded platform: bazel build --config=s32k148 //...
    • Run all bazel tests: bazel test //...
  • Refactored all workflows to use a shared setup-docker-env composite action for Docker image build and Bazel cache directory setup.
  • Add buildifier_prebuilt 8.5.1.1 dev dependency to MODULE.bazel
  • Add //:format_check and //:format_fix targets via buildifier_prebuilt
  • Add buildifier to Docker image and add it as a formatter to treefmt.
  • Apply Bazel file formatting fixes

NOTE: Docker bind mount permission issues:
Bazelisk/Bazel cache directories created by Docker bind mounts via create_host_path: true are owned by root, causing permission errors for the unprivileged container user. It seems this is a fundamental, unresolved Docker Engine limitation (moby/moby#2259 has been open since 2013).
Instead create_host_path: false is used and it's the users responsibility to set up the cache dirs locally. This will be added to the README and Bazel quick start guide once the Bazel related sections are added.


NOTE: We have decided to keep two instances of buildifier for now:

  • Docker instance for treefmt support
  • Bazel module instance for native Bazel formatting/linting

@DominikAFischer DominikAFischer force-pushed the cr-532643 branch 13 times, most recently from 7c8a332 to e90a3b7 Compare May 21, 2026 14:43
Comment thread libs/bsw/util/BUILD.bazel Outdated
Comment thread .github/workflows/bazel.yml Outdated
Comment thread .github/workflows/bazel.yml Outdated
Comment thread docker-compose.yaml Outdated
@DominikAFischer DominikAFischer force-pushed the cr-532643 branch 4 times, most recently from 10d3c88 to 179b9f8 Compare May 26, 2026 11:15
- Add bazel github action workflow
- Add buildifier_prebuilt 8.5.1.1 dev dependency to MODULE.bazel
- Add //:format_check and //:format_fix targets via buildifier_prebuilt

Change-Id: Ie1a9a60d88336ebce2785e9ccb80d30053c1175a
Change-Id: Ib2857ad50f21541c7dfc12013fbb05bf633f0fac
Change-Id: I971a88188dbbd94d8537ebbe8194e0dd6c84c29b
Change-Id: I16bff2f980fb8623a8399170cd2cf9ff0b62c94b
Change-Id: I86bb6733e924cce83d939023e4016ddc09eed089
Change-Id: Ie7a8c13a96a03f0576a79d151788fc3af0a69ef5
Change-Id: I2cae6ce5f25c93feff46696aabcfdfd808654a03
@DominikAFischer DominikAFischer force-pushed the cr-532643 branch 2 times, most recently from de479a7 to e7f77d1 Compare May 26, 2026 11:45
Change-Id: I432d900f7d86ca5b5a097fdc8d00c21b0ffe8581
@DominikAFischer DominikAFischer force-pushed the cr-532643 branch 2 times, most recently from 518b5b1 to cd58d6e Compare May 26, 2026 14:15
@DominikAFischer
Copy link
Copy Markdown
Contributor Author

DominikAFischer commented May 27, 2026

False positive / flaky test uds/test_udsToolRDBI.py::test_rdbi[posix] in workflow Run pytest for posix platform / run-pytest-on-posix identified.
Increasing this timeout fixes the issue and confirms the root cause. For a proper fix this timeout should be replaced by properly handling it using either polling or something like pexpect.
EDIT: The issue has been raised to the maintainer and a proper fix is underway.

Copy link
Copy Markdown
Contributor

@christophruethingbmw christophruethingbmw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just wait for the fix of the flaky test, PR for that should come soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants