Skip to content

Commit

Permalink
Split clang-tidy workflow into two parts
Browse files Browse the repository at this point in the history
The full clang-tidy run takes too long, so split it into one part for
src and one for everything else.
  • Loading branch information
jbytheway committed Apr 23, 2023
1 parent 2b55182 commit f52d0ce
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ jobs:
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}

strategy:
fail-fast: true
matrix:
# To make the run finish in the run time limit, we split it up into two
# parts: the src directory and everything else
subset: [ 'src', 'other' ]

runs-on: ubuntu-20.04
env:
CMAKE: 1
CLANG: clang++-12
COMPILER: clang++-12
CATA_CLANG_TIDY: plugin
CATA_CLANG_TIDY_SUBSET: ${{ matrix.subset }}
TILES: 1
SOUND: 1
RELEASE: 1
Expand Down
13 changes: 13 additions & 0 deletions build-scripts/clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ else
fi
fi

printf "Subset to analyze: '%s'\n" "$CATA_CLANG_TIDY_SUBSET"

# We might need to analyze only a subset of the files if they have been split
# into multiple jobs for efficiency
case "$CATA_CLANG_TIDY_SUBSET" in
( src )
tidyable_cpp_files=$(printf '%s\n' "$tidyable_cpp_files" | grep '/src/')
;;
( other )
tidyable_cpp_files=$(printf '%s\n' "$tidyable_cpp_files" | grep -v '/src/')
;;
esac

function analyze_files_in_random_order
{
if [ -n "$1" ]
Expand Down

0 comments on commit f52d0ce

Please sign in to comment.