diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d6ff16a..adff422d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,7 @@ jobs: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-get update sudo apt-get install -q -y clang-tidy-18 - - name: static checks on diff - if: ${{ github.event_name == 'push' }} - run: | - export CLANG_TIDY_DIFF=clang-tidy-diff-18.py - scripts/check-tidy-diff.sh - name: static checks - if : ${{ github.event_name == 'pull_request' }} run: | export CLANG_TIDY=clang-tidy-18 make tidy diff --git a/scripts/check-tidy-diff.sh b/scripts/check-tidy-diff.sh deleted file mode 100755 index 208b4c19..00000000 --- a/scripts/check-tidy-diff.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env sh - -# -# Runs clang-tidy on the diff between main and HEAD. -# Note: This script is intended to be run in CI triggered by pull requests. -# - -set -eu - -if [ -z "${GITHUB_ACTIONS+x}" ]; then - echo "error: this script is intended to be run in CI" - exit 1 -fi - -CLANG_TIDY_DIFF=${CLANG_TIDY_DIFF:-clang-tidy-diff.py} - -command -v bear >/dev/null 2>&1 || ( - echo "error: bear is required to generate compile_commands.json; see https://github.com/rizsotto/Bear" - exit 1 -) - -# Run a clean build to generate compile_commands.json. -make clean -bear -- make -git fetch origin "${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}" -git diff -U0 "origin/${GITHUB_BASE_REF}" -- ':!test/' | ${CLANG_TIDY_DIFF} -p1