mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
This gets the majority of projects from mostrobotpy building in this mirror. Projects missing still are cscore and the halsim wrappers.
157 lines
4.5 KiB
YAML
157 lines
4.5 KiB
YAML
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=ci_windows_x86", }
|
|
- { name: "Windows (arm)", os: windows-2022, action: "build", config: "--config=windows_arm --config=ci_windows_arm", }
|
|
|
|
name: "Build ${{ matrix.name }}"
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with: { fetch-depth: 0 }
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: 21
|
|
architecture: x64
|
|
|
|
- id: Setup_bazel_remote
|
|
uses: ./.github/actions/setup-bazel-remote
|
|
with:
|
|
username: ${{ secrets.BAZEL_CACHE_USERNAME }}
|
|
password: ${{ secrets.BAZEL_CACHE_PASSWORD }}
|
|
|
|
- name: bazel ${{ matrix.action }}
|
|
run: bazel ${{ matrix.action }} ... --config=ci ${{ matrix.config }} --verbose_failures
|
|
shell: bash
|
|
|
|
build-mac:
|
|
name: "Mac"
|
|
runs-on: macOS-15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with: { fetch-depth: 0 }
|
|
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: 21
|
|
|
|
- id: Setup_bazel_remote
|
|
uses: ./.github/actions/setup-bazel-remote
|
|
with:
|
|
username: ${{ secrets.BAZEL_CACHE_USERNAME }}
|
|
password: ${{ secrets.BAZEL_CACHE_PASSWORD }}
|
|
|
|
- name: bazel test (release)
|
|
run: bazel test ... --config=ci -c opt --nojava_header_compilation --verbose_failures
|
|
shell: bash
|
|
|
|
build-linux:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { name: "Linux", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "test", config: "", }
|
|
name: "${{ matrix.name }}"
|
|
runs-on: ${{ matrix.os }}
|
|
container: ${{ matrix.container }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with: { fetch-depth: 0 }
|
|
- uses: bazelbuild/setup-bazelisk@v3
|
|
|
|
- id: Setup_bazel_remote
|
|
uses: ./.github/actions/setup-bazel-remote
|
|
with:
|
|
username: ${{ secrets.BAZEL_CACHE_USERNAME }}
|
|
password: ${{ secrets.BAZEL_CACHE_PASSWORD }}
|
|
|
|
- uses: bazel-contrib/setup-bazel@0.15.0
|
|
with:
|
|
bazelisk-cache: true
|
|
repository-cache: true
|
|
bazelisk-version: 1.x
|
|
|
|
- name: bazel ${{ matrix.action }} (release)
|
|
run: bazel ${{ matrix.action }} ... --config=ci -c opt ${{ matrix.config }} --verbose_failures
|
|
|
|
buildifier:
|
|
name: "buildifier"
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Set up Go 1.15.x
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
cache: false
|
|
go-version: 1.15.x
|
|
id: go
|
|
|
|
- name: Install Buildifier
|
|
run: |
|
|
cd $(mktemp -d)
|
|
GO111MODULE=on go get github.com/bazelbuild/buildtools/buildifier@6.0.0
|
|
|
|
- uses: actions/checkout@v4
|
|
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@v4
|
|
with:
|
|
name: ${{ matrix.platform }}-bazel-lint-fixes
|
|
path: bazel-lint-fixes.patch
|
|
if: ${{ failure() }}
|
|
|
|
robotpy_pregeneration:
|
|
name: "Robotpy Pregeneration"
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with: { fetch-depth: 0 }
|
|
|
|
- id: Setup_build_buddy
|
|
uses: ./.github/actions/setup-build-buddy
|
|
with:
|
|
token: ${{ secrets.BUILDBUDDY_API_KEY }}
|
|
|
|
# You should ensure the headers are correct before trying to pregen files
|
|
- name: Test Scan Headers
|
|
run: bazel test //... -k --test_tag_filters=robotpy_scan_headers --build_tests_only
|
|
shell: bash
|
|
|
|
- name: Run robotpy pregeneration
|
|
run: bazel run //:write_robotpy_files
|
|
|
|
- name: Check Output
|
|
run: git --no-pager diff --exit-code HEAD
|
|
|
|
- name: Generate diff
|
|
run: git diff HEAD > robotpy-pregeneration.patch
|
|
if: ${{ failure() }}
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.platform }}-robotpy-pregeneration-fixes
|
|
path: robotpy-pregeneration-fixes.patch
|
|
if: ${{ failure() }}
|