Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into better-initial-guess-wpi-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
bruingineer committed Jun 20, 2024
2 parents 58ef24e + 4df4263 commit 2764b1b
Show file tree
Hide file tree
Showing 54 changed files with 1,260 additions and 1,256 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/build-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,47 @@ jobs:
- artifact-name: Rust Native - Windows x86_64 (CasADi)
optimizer_backend: casadi
os: windows-2022
cmake-env:
cargo-build-flags:
- artifact-name: Rust Native - macOS x86_64 (CasADi)
optimizer_backend: casadi
os: macOS-13
os: macOS-14
cmake-env: CMAKE_OSX_ARCHITECTURES="x86_64"
cargo-build-flags:
- artifact-name: Rust Native - macOS arm64 (CasADi)
optimizer_backend: casadi
os: macOS-14
cmake-env: CMAKE_OSX_ARCHITECTURES="arm64"
cargo-build-flags:
- artifact-name: Rust Native - Linux x86_64 (CasADi)
optimizer_backend: casadi
os: ubuntu-24.04
cmake-env:
cargo-build-flags:
- artifact-name: Rust Native - Windows x86_64 (Sleipnir)
optimizer_backend: sleipnir
os: windows-2022
cmake-env:
cargo-build-flags:
- artifact-name: Rust Native - Windows aarch64 (Sleipnir)
optimizer_backend: sleipnir
os: windows-2022
cmake-env:
cargo-build-flags: --target aarch64-pc-windows-msvc
- artifact-name: Rust Native - macOS x86_64 (Sleipnir)
optimizer_backend: sleipnir
os: macOS-13
cargo-build-flags:
- artifact-name: Rust Native - macOS arm64 (Sleipnir)
- artifact-name: Rust Native - macOS universal (Sleipnir)
optimizer_backend: sleipnir
os: macOS-14
cmake_env:
cargo-build-flags:
- artifact-name: Rust Native - Linux x86_64 (Sleipnir)
optimizer_backend: sleipnir
os: ubuntu-24.04
cmake-env:
cargo-build-flags:
- artifact-name: Rust Native - Linux aarch64 (Sleipnir)
optimizer_backend: sleipnir
os: ubuntu-24.04
cmake-env:
cargo-build-flags: --target aarch64-unknown-linux-gnu

name: "${{ matrix.artifact-name }}"
Expand Down Expand Up @@ -80,10 +85,21 @@ jobs:
if: matrix.artifact-name == 'Rust Native - Linux aarch64 (Sleipnir)'
run: |
sudo apt-get update -q
sudo apt-get install -y g++-aarch64-linux-gnu
sudo apt-get install -y g++-14-aarch64-linux-gnu
sudo update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-14 200
sudo update-alternatives --install /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ /usr/bin/aarch64-linux-gnu-g++-14 200
rustup target install aarch64-unknown-linux-gnu
- run: cargo build ${{ matrix.cargo-build-flags }} --features ${{ matrix.optimizer_backend }}
- name: Make GCC 14 the default toolchain (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 200
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 200
- run: sudo xcode-select -switch /Applications/Xcode_15.3.app
if: startsWith(matrix.os, 'macOS')

- run: ${{matrix.cmake-env }} cargo build ${{ matrix.cargo-build-flags }} --features ${{ matrix.optimizer_backend }}

- run: cargo run --example swerve --features ${{ matrix.optimizer_backend }}
if: matrix.artifact-name != 'Rust Native - Windows aarch64 (Sleipnir)' &&
Expand Down
35 changes: 20 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,37 @@ jobs:
include:
- artifact-name: Native - Windows (CasADi)
# FIXME: Tests give "Exit code 0xc0000135" for missing DLLs
cmake-flags: "-G \"MinGW Makefiles\" -DBUILD_TESTING=OFF"
cmake-args: "-G \"MinGW Makefiles\" -DBUILD_TESTING=OFF"
optimizer_backend: casadi
os: windows-2022
- artifact-name: Native - macOS x86_64 (CasADi)
cmake-flags:
cmake-args: -DCMAKE_OSX_ARCHITECTURES="x86_64"
optimizer_backend: casadi
os: macOS-13
os: macOS-14
- artifact-name: Native - macOS arm64 (CasADi)
cmake-flags:
cmake-args: -DCMAKE_OSX_ARCHITECTURES="arm64"
optimizer_backend: casadi
os: macOS-14
- artifact-name: Native - Linux x86_64 (CasADi)
cmake-flags:
cmake-args:
optimizer_backend: casadi
os: ubuntu-24.04
- artifact-name: Native - Windows x86_64 (Sleipnir)
# FIXME: Tests give "Exit code 0xc0000135" for missing DLLs
cmake-flags: "-DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_TESTING=OFF"
cmake-args: "-DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_TESTING=OFF"
optimizer_backend: sleipnir
os: windows-2022
- artifact-name: Native - Windows aarch64 (Sleipnir)
# FIXME: Tests give "Exit code 0xc0000135" for missing DLLs
cmake-flags: "-DCMAKE_GENERATOR_PLATFORM=ARM64 -DBUILD_TESTING=OFF"
cmake-args: "-DCMAKE_GENERATOR_PLATFORM=ARM64 -DBUILD_TESTING=OFF"
optimizer_backend: sleipnir
os: windows-2022
- artifact-name: Native - macOS x86_64 (Sleipnir)
cmake-flags:
optimizer_backend: sleipnir
os: macOS-13
- artifact-name: Native - macOS arm64 (Sleipnir)
cmake-flags:
- artifact-name: Native - macOS universal (Sleipnir)
cmake-args: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
optimizer_backend: sleipnir
os: macOS-14
- artifact-name: Native - Linux x86_64 (Sleipnir)
cmake-flags:
cmake-args:
optimizer_backend: sleipnir
os: ubuntu-24.04

Expand All @@ -65,7 +61,16 @@ jobs:
choco upgrade mingw --version=11.2.0 -y --no-progress --allow-downgrade
echo C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin >> $env:GITHUB_PATH
- run: cmake -B build -S . ${{ matrix.cmake-flags }} -DOPTIMIZER_BACKEND=${{ matrix.optimizer_backend }}
- name: Make GCC 14 the default toolchain (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 200
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 200
- run: sudo xcode-select -switch /Applications/Xcode_15.3.app
if: startsWith(matrix.os, 'macOS')

- run: cmake -B build -S . -DBUILD_EXAMPLES=ON ${{ matrix.cmake-args }} -DOPTIMIZER_BACKEND=${{ matrix.optimizer_backend }}
- run: cmake --build build --config RelWithDebInfo --parallel $(nproc)
- run: ctest --test-dir build -C RelWithDebInfo --output-on-failure
- run: cmake --install build --config RelWithDebInfo --prefix pkg
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ jobs:
with:
python-version: 3.12

- name: Install LLVM 17
- name: Install LLVM 18
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 200
sudo ./llvm.sh 18 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 200
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
Expand All @@ -87,13 +87,21 @@ jobs:
run: wpiformat -list-changed-files

- name: Run clang-tidy
run: wpiformat -no-format -tidy-all -compile-commands=build -tidy-extra-args std=c++20 -vv
run: wpiformat -no-format -tidy-all -compile-commands=build -tidy-extra-args std=c++23 -vv

format-rust:
name: "Format Rust"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Make GCC 14 the default toolchain
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 200
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 200
- run: cargo fmt --check

- run: cargo clippy --features casadi -- -D warnings

- run: cargo clippy --features sleipnir -- -D warnings
48 changes: 48 additions & 0 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Sanitizers

on: [pull_request, push]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- sanitizer-name: asan
cmake-args: "-DCMAKE_BUILD_TYPE=Asan"
optimizer_backend: sleipnir
- sanitizer-name: tsan
cmake-args: "-DCMAKE_BUILD_TYPE=Tsan"
optimizer_backend: sleipnir
- sanitizer-name: ubsan
cmake-args: "-DCMAKE_BUILD_TYPE=Ubsan"
optimizer_backend: sleipnir
- sanitizer-name: asan
cmake-args: "-DCMAKE_BUILD_TYPE=Asan"
optimizer_backend: casadi
- sanitizer-name: tsan
cmake-args: "-DCMAKE_BUILD_TYPE=Tsan"
optimizer_backend: casadi
- sanitizer-name: ubsan
cmake-args: "-DCMAKE_BUILD_TYPE=Ubsan"
optimizer_backend: casadi

name: "${{ matrix.sanitizer-name }} with ${{ matrix.optimizer_backend }}"
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Make GCC 14 the default toolchain (Linux)
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 200
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 200
- run: cmake -B build -S . -DBUILD_EXAMPLES=ON ${{ matrix.cmake-args }} -DOPTIMIZER_BACKEND=${{ matrix.optimizer_backend }}
- run: cmake --build build --config RelWithDebInfo --parallel $(nproc)
- run: ctest --test-dir build -C RelWithDebInfo --output-on-failure
2 changes: 1 addition & 1 deletion .styleguide
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cppHeaderFileInclude {
\.h$
\.hpp$
\.inc$
expected$
}

Expand All @@ -12,6 +11,7 @@ cppSrcFileInclude {
modifiableFileExclude {
\.patch$
expected$
\.patch$
}

includeOtherLibs {
Expand Down
Loading

0 comments on commit 2764b1b

Please sign in to comment.