Skip to content

[wpimath] Add remaining struct and protobuf implementations #12897

[wpimath] Add remaining struct and protobuf implementations

[wpimath] Add remaining struct and protobuf implementations #12897

Workflow file for this run

name: CMake
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
name: Linux
container: wpilib/roborio-cross-ubuntu:2024-22.04
flags: "-DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON"
- os: macOS-14
name: macOS
container: ""
env: "PATH=\"/opt/homebrew/opt/protobuf@3/bin:$PATH\""
flags: "-DCMAKE_BUILD_TYPE=Release -DWITH_JAVA=OFF -DWITH_EXAMPLES=ON -DCMAKE_LIBRARY_PATH=/opt/homebrew/opt/protobuf@3/lib -DProtobuf_INCLUDE_DIR=/opt/homebrew/opt/protobuf@3/include -DProtobuf_PROTOC_EXECUTABLE=/opt/homebrew/opt/protobuf@3/bin/protoc"
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 libopencv4.5-java libprotobuf-dev protobuf-compiler ninja-build
- name: Install dependencies (macOS)
run: brew install opencv protobuf@3 ninja
if: runner.os == 'macOS'
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- uses: actions/checkout@v4
- name: configure
run: cmake -S . -B build -G "Ninja" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ matrix.flags }}
env:
SCCACHE_GHA_ENABLED: "true"
- name: build
working-directory: build
run: cmake --build . --parallel $(nproc)
env:
SCCACHE_GHA_ENABLED: "true"
- name: test
working-directory: build
run: ctest --output-on-failure
build-windows:
name: "Build - Windows"
runs-on: windows-2022
steps:
- uses: ilammy/[email protected]
- name: Install CMake
uses: lukka/[email protected]
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- uses: actions/checkout@v4
- name: Run vcpkg
uses: lukka/[email protected]
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg
vcpkgGitCommitId: 37c3e63a1306562f7f59c4c3c8892ddd50fdf992 # HEAD on 2024-02-24
- name: configure
run: cmake -S . -B build -G "Ninja" -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DWITH_JAVA=OFF -DWITH_EXAMPLES=ON -DUSE_SYSTEM_FMTLIB=ON -DUSE_SYSTEM_LIBUV=ON -DUSE_SYSTEM_EIGEN=OFF -DCMAKE_TOOLCHAIN_FILE=${{ 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
env:
SCCACHE_GHA_ENABLED: "true"
- name: build
working-directory: build
run: cmake --build . --parallel $(nproc)
env:
SCCACHE_GHA_ENABLED: "true"
- name: test
working-directory: build
# UnitTest_test segfaults on exit occasionally
run: ctest --output-on-failure -E 'UnitTest'