Update dependencies in prep for Bazel 7 #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bazel | |
on: [pull_request, push] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { name: "Windows (native)", os: windows-2022, action: "test", config: "--config=windows --noenable_bzlmod", } | |
- { name: "Windows (bzlmod)", os: windows-2022, action: "test", config: "--config=windows --enable_bzlmod", } | |
- { name: "Windows (arm)", os: windows-2022, action: "build", config: "--config=windows_arm --noenable_bzlmod", } | |
- { name: "Windows (arm bzlmod)", os: windows-2022, action: "build", config: "--config=windows_arm --enable_bzlmod", } | |
- { name: "Windows (roborio)", os: windows-2022, action: "build", config: "--config=roborio --noenable_bzlmod", } | |
# - { name: "Windows (roborio bzlmod)", os: windows-2022, action: "build", config: "--config=roborio --enable_bzlmod", } | |
- { name: "Windows (bullseye32)", os: windows-2022, action: "build", config: "--config=bullseye32 --noenable_bzlmod", } | |
- { name: "Windows (bullseye32 bzlmod)", os: windows-2022, action: "build", config: "--config=bullseye32 --enable_bzlmod", } | |
- { name: "Windows (bullseye64)", os: windows-2022, action: "build", config: "--config=bullseye64 --noenable_bzlmod", } | |
- { name: "Windows (bullseye64 bzlmod)", os: windows-2022, action: "build", config: "--config=bullseye64 --enable_bzlmod", } | |
- { name: "Windows (raspi32)", os: windows-2022, action: "build", config: "--config=raspi32 --noenable_bzlmod", } | |
- { name: "Windows (raspi32 bzlmod)", os: windows-2022, action: "build", config: "--config=raspi32 --enable_bzlmod", } | |
name: "Build ${{ matrix.name }}" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: { fetch-depth: 0 } | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
architecture: x64 | |
- name: Build wpimath dependencies | |
run: bazel --output_user_root=C:\\bazelroot ${{ matrix.action }} -k wpiutil/... --config=ci ${{ matrix.config }} --nojava_header_compilation --verbose_failures | |
shell: bash | |
- name: Build wpimath | |
run: bazel --output_user_root=C:\\bazelroot build -k wpimath/... --config=ci ${{ matrix.config }} --local_cpu_resources=1 --nojava_header_compilation --verbose_failures | |
shell: bash | |
- name: Build allowing failures | |
run: bazel --output_user_root=C:\\bazelroot build -k ... --config=ci ${{ matrix.config }} --nojava_header_compilation --verbose_failures || true | |
shell: bash | |
- name: Build | |
run: bazel --output_user_root=C:\\bazelroot ${{ matrix.action }} -k ... --config=ci ${{ matrix.config }} --nojava_header_compilation --verbose_failures | |
shell: bash | |
build-mac: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { name: "Mac (native)", os: macos-14, action: "test", config: "--config=osx -c opt --noenable_bzlmod", } | |
- { name: "Mac (bzlmod)", os: macos-14, action: "test", config: "--config=osx -c opt --enable_bzlmod" } | |
- { name: "Mac (roborio)", os: macos-14, action: "build", config: "--config=roborio -c opt --noenable_bzlmod", } | |
- { name: "Mac (roborio bzlmod)", os: macos-14, action: "build", config: "--config=roborio -c opt --enable_bzlmod" } | |
- { name: "Mac (bullseye32)", os: macos-14, action: "build", config: "--config=bullseye32 -c opt --noenable_bzlmod", } | |
- { name: "Mac (bullseye32 bzlmod)", os: macos-14, action: "build", config: "--config=bullseye32 -c opt --enable_bzlmod" } | |
- { name: "Mac (bullseye64)", os: macos-14, action: "build", config: "--config=bullseye64 -c opt --noenable_bzlmod", } | |
- { name: "Mac (bullseye64 bzlmod)", os: macos-14, action: "build", config: "--config=bullseye64 -c opt --enable_bzlmod" } | |
- { name: "Mac (raspi32)", os: macos-14, action: "build", config: "--config=raspi32 -c opt --noenable_bzlmod", } | |
- { name: "Mac (raspi32 bzlmod)", os: macos-14, action: "build", config: "--config=raspi32 -c opt --enable_bzlmod" } | |
name: "${{ matrix.name }}" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: { fetch-depth: 0 } | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
architecture: aarch64 | |
- name: Build allowing failures | |
run: bazel build -k ... --config=ci ${{ matrix.config }} --nojava_header_compilation --verbose_failures || true | |
shell: bash | |
- name: Build | |
run: bazel ${{ matrix.action }} -k ... --config=ci ${{ matrix.config }} --nojava_header_compilation --verbose_failures | |
shell: bash | |
# - name: Check Lockfile update | |
# run: git --no-pager diff --exit-code HEAD | |
build-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { container: "wpilib/ubuntu-base:22.04", action: "test", artifact-name: "Linux (native)", config: "--config=linux --noenable_bzlmod", } | |
- { container: "wpilib/ubuntu-base:22.04", action: "test", artifact-name: "Linux (bzlmod)", config: "--config=linux --enable_bzlmod" } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (roborio)", config: "--config=roborio --noenable_bzlmod", } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (roborio bzlmod)", config: "--config=roborio --enable_bzlmod" } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (bullseye32)", config: "--config=bullseye32 --noenable_bzlmod", } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (bullseye32 bzlmod)", config: "--config=bullseye32 --enable_bzlmod" } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (bullseye64)", config: "--config=bullseye64 --noenable_bzlmod", } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (bullseye64 bzlmod)", config: "--config=bullseye64 --enable_bzlmod" } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (raspi32)", config: "--config=raspi32 --noenable_bzlmod", } | |
- { container: "wpilib/ubuntu-base:22.04", action: "build", artifact-name: "Linux (raspi32 bzlmod)", config: "--config=raspi32 --enable_bzlmod" } | |
runs-on: ubuntu-22.04 | |
name: "Build - ${{ matrix.artifact-name }}" | |
container: ${{ matrix.container }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: { fetch-depth: 0 } | |
- uses: bazelbuild/setup-bazelisk@v1 | |
- name: Build and allow failures | |
run: bazel build ... --config=ci ${{ matrix.config }} -k --verbose_failures || true | |
- name: Build and Test | |
run: bazel ${{ matrix.action }} ... --config=ci ${{ matrix.config }} -k --verbose_failures | |
repin-maven: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: bazel run --noenable_bzlmod @unpinned_maven//:pin | |
- run: git diff HEAD | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: Re-pinned maven | |
path: shared/bazel/deps/maven_install.json | |
build-sanitizers: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- config: "tsan" | |
- config: "asan" | |
- config: "ubsan" | |
runs-on: ubuntu-22.04 | |
container: wpilib/ubuntu-base:22.04 | |
name: "Sanitizer ${{ matrix.config }}" | |
steps: | |
- uses: actions/checkout@v3 | |
with: { fetch-depth: 0 } | |
- uses: bazelbuild/setup-bazelisk@v1 | |
- name: Build and Test | |
run: bazel test -k --config=ci --config=linux --noenable_bzlmod --config=${{ matrix.config }} //... | |
build-coverage: | |
runs-on: ubuntu-22.04 | |
name: "Code Coverage" | |
steps: | |
- uses: actions/checkout@v3 | |
with: { fetch-depth: 0 } | |
- name: Install LCOV | |
run: sudo apt-get install -y lcov | |
- name: Build, allow buildbudy failure | |
run: bazel coverage --config=ci --config=linux --noenable_bzlmod -k -- //... -//simulation/halsim_gui/src/test/native/cpp:halsim_gui-test -//sysid/src/test/native:sysid-test | |
- name: genhtml | |
run: | | |
genhtml bazel-out/_coverage/_coverage_report.dat -o coverage_report/combined | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: "Coverage" | |
path: coverage_report | |
buildifier: | |
name: "buildifier" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Go 1.15.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.15.x | |
id: go | |
- name: Install Buildifier | |
run: | | |
cd $(mktemp -d) | |
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected] | |
- uses: actions/checkout@v3 | |
with: { fetch-depth: 0 } | |
- name: Run buildifier | |
run: buildifier -warnings all --lint=fix -r . | |
- name: Check Output | |
run: git --no-pager diff --exit-code HEAD | |
- name: Generate diff | |
run: git diff HEAD > bazel-lint-fixes.patch | |
if: ${{ failure() }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.platform }}-bazel-lint-fixes | |
path: bazel-lint-fixes.patch | |
if: ${{ failure() }} | |
unused_deps: | |
name: "unused_deps" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Go 1.15.x | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.15.x | |
id: go | |
- uses: actions/checkout@v3 | |
- name: Install Unused Deps | |
run: | | |
cd $(mktemp -d) | |
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected] | |
- name: Install Buildozer | |
run: | | |
cd $(mktemp -d) | |
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected] | |
- name: Dump Platform Flag | |
run: | | |
echo "# Flags for unused deps" > user.bazelrc | |
echo "build --config=linux" >> user.bazelrc | |
echo "build --config=ci" >> user.bazelrc | |
echo "build --build_tag_filters=-wpi-cpp-gui" >> user.bazelrc | |
echo "build --test_tag_filters=-wpi-cpp-gui" >> user.bazelrc | |
- name: Debug userrc | |
run: cat user.bazelrc | |
- name: Prep unused deps | |
run: bazel query --tool_tag=unused_deps --keep_going "kind('(kt|java|android)_*', //...)" || true | |
- name: Run unused deps | |
run: unused_deps -cquery //... > buildozer-cmds.sh | |
- name: Show unused deps | |
run: cat buildozer-cmds.sh | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: Upload Unused Deps Script | |
path: buildozer-cmds.sh | |
- name: Fix unused deps | |
run: chmod +x buildozer-cmds.sh && ./buildozer-cmds.sh | |
- name: Generate diff | |
run: git diff > bazel-unused-deps-fixes.patch | |
- name: Check Output | |
run: git --no-pager diff --exit-code HEAD | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: Upload Unused Deps Patch | |
path: bazel-unused-deps-fixes.patch | |
if: ${{ failure() }} |