mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
libprotobuf is a very annoying dependency to deal with, and with the switch to nanopb for generated C++ code, libprotobuf is only used for dynamic decode in the GUI apps. libprotobuf has been swapped out with upb, a much smaller C-based library that supports reflection and can therefore do dynamic decode. This means we can remove the libprotobuf dependency and stop dealing with build issues because of it.
85 lines
2.9 KiB
YAML
85 lines
2.9 KiB
YAML
name: CMake
|
|
|
|
on: [pull_request, push]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
SCCACHE_WEBDAV_ENDPOINT: "https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-cmake-local"
|
|
SCCACHE_WEBDAV_KEY_PREFIX: "sccache"
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-24.04
|
|
name: Linux
|
|
container: wpilib/systemcore-cross-ubuntu:2027-24.04
|
|
flags: "--preset with-java-and-sccache -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON"
|
|
- os: macOS-14
|
|
name: macOS
|
|
container: ""
|
|
flags: "--preset with-sccache -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON"
|
|
- os: windows-2022
|
|
name: Windows
|
|
container: ""
|
|
flags: '--preset with-sccache -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DUSE_SYSTEM_FMTLIB=ON -DUSE_SYSTEM_LIBUV=ON -DUSE_SYSTEM_EIGEN=OFF -DCMAKE_TOOLCHAIN_FILE="$Env:RUNNER_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_INSTALL_OPTIONS=--clean-after-build -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release'
|
|
|
|
name: "Build - ${{ matrix.name }}"
|
|
runs-on: ${{ matrix.os }}
|
|
container: ${{ matrix.container }}
|
|
steps:
|
|
- name: Install dependencies (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: sudo apt-get update && sudo apt-get install -y libopencv-dev libopencv-java ninja-build
|
|
|
|
- name: Install dependencies (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: brew install opencv ninja
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1.13.0
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Install CMake (Windows only)
|
|
if: runner.os == 'Windows'
|
|
uses: lukka/get-cmake@v3.29.3
|
|
|
|
- name: Install sccache
|
|
uses: mozilla-actions/sccache-action@v0.0.9
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Run vcpkg (Windows only)
|
|
if: runner.os == 'Windows'
|
|
uses: lukka/run-vcpkg@v11.5
|
|
with:
|
|
vcpkgDirectory: ${{ runner.workspace }}/vcpkg
|
|
vcpkgGitCommitId: 37c3e63a1306562f7f59c4c3c8892ddd50fdf992 # HEAD on 2024-02-24
|
|
|
|
- name: configure
|
|
run: cmake ${{ matrix.flags }}
|
|
env:
|
|
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
|
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
|
|
|
- name: build
|
|
run: cmake --build build-cmake --parallel $(nproc)
|
|
env:
|
|
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
|
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
|
|
|
- name: test
|
|
if: runner.os != 'Windows'
|
|
working-directory: build-cmake
|
|
run: ctest --output-on-failure
|
|
|
|
- name: test (windows)
|
|
if: runner.os == 'Windows'
|
|
working-directory: build-cmake
|
|
# UnitTest_test segfaults on exit occasionally
|
|
run: ctest --output-on-failure -E 'UnitTest'
|