From 70caa37619c540fde433ff34da414856ae85ece7 Mon Sep 17 00:00:00 2001 From: Joseph Eng Date: Sat, 12 Aug 2023 09:37:08 -0700 Subject: [PATCH] Add clang-tidy workflow --- .github/workflows/clang-tidy.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/clang-tidy.yml diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml new file mode 100644 index 00000000000..5a7db458917 --- /dev/null +++ b/.github/workflows/clang-tidy.yml @@ -0,0 +1,27 @@ +name: Run clang-tidy + +jobs: + tidy: + name: "clang-tidy" + runs-on: ubuntu-22.04 + container: wpilib/roborio-cross-ubuntu:2023-22.04 + steps: + - uses: actions/checkout@v3 + - name: Fetch all history and metadata + run: | + git config --global --add safe.directory /__w/allwpilib/allwpilib + git fetch --prune --unshallow + git checkout -b pr + git branch -f main origin/main + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Install wpiformat + run: pip3 install wpiformat + - name: Create compile_commands.json + run: ./gradlew generateCompileCommands -Ptoolchain-optional-roboRio + - name: List changed files + run: wpiformat -list-changed-files + - name: Run clang-tidy + run: wpiformat -no-format -tidy-changed -compile-commands=build/compile_commands/linuxx86-64 -vv