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

Remove redundant #include #1388

Remove redundant #include

Remove redundant #include #1388

Workflow file for this run

name: Lint and Format
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
wpiformat:
name: "wpiformat"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all history and metadata
run: |
git checkout -b pr
git branch -f main origin/main
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: pip3 install wpiformat==2024.33
- run: wpiformat
- name: Check output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > wpiformat-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v4
with:
name: wpiformat fixes
path: wpiformat-fixes.patch
if: ${{ failure() }}
- name: Write to job summary
run: |
echo '```diff' >> $GITHUB_STEP_SUMMARY
cat wpiformat-fixes.patch >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
if: ${{ failure() }}
tidy:
name: "clang-tidy"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all history and metadata
run: |
git config --global --add safe.directory /__w/TrajoptLib/TrajoptLib
git checkout -b pr
git branch -f main origin/main
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install LLVM 18
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
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
- run: pip3 install wpiformat
- name: Create compile_commands.json
run: cmake -B build -S . -DOPTIMIZER_BACKEND=sleipnir -DCMAKE_EXPORT_COMPILE_COMMANDS=YES
- name: List changed files
run: wpiformat -list-changed-files
- name: Run clang-tidy
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 -- -D warnings