Skip to content

Commit

Permalink
Merge pull request #79234 from moxian/workflow-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
akrieger authored Jan 19, 2025
2 parents 87e7cfd + db82486 commit b36cbc7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
- name: checkout repository
uses: actions/checkout@v4
- name: download plugin from the previous job in this workflow run
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' && github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
uses: actions/download-artifact@v4
with:
name: cata-analyzer-plugin
Expand Down
25 changes: 18 additions & 7 deletions build-scripts/clang-tidy-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,33 @@ set -exo pipefail

num_jobs=3

# enable all the switches by default
BACKTRACE=${BACKTRACE:-1}
LOCALIZE=${LOCALIZE:-1}
TILES=${TILES:-1}
SOUND=${SOUND:-1}

# create compilation database (compile_commands.json)
mkdir -p build
cd build
cmake \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
${COMPILER:+-DCMAKE_CXX_COMPILER=$COMPILER} \
-DCMAKE_BUILD_TYPE="Release" \
-DBACKTRACE=ON \
-DTILES=${TILES:-0} \
-DSOUND=${SOUND:-0} \
-DLOCALIZE=${LOCALIZE:-0} \
-DBACKTRACE=${BACKTRACE} \
-DLOCALIZE=${LOCALIZE} \
-DTILES=${TILES} \
-DSOUND=${SOUND} \
..
cd ..
ln -s build/compile_commands.json .
ln --force --symbolic build/compile_commands.json .

if [ ! -f build/tools/clang-tidy-plugin/libCataAnalyzerPlugin.so ]
then
echo "Cata plugin not found. Assuming we're in CI and bailing out."
echo "If you are running clang-tidy locally with no plugin, consider"
echo "calling it explicitly with the files you care to check."
echo 'e.g. `clang-tidy src/item* tests/item*` '
exit 1
fi

Expand Down Expand Up @@ -59,8 +68,10 @@ else
--silent \
-j $num_jobs \
${COMPILER:+COMPILER=$COMPILER} \
TILES=${TILES:-0} \
SOUND=${SOUND:-0} \
BACKTRACE=${BACKTRACE} \
LOCALIZE=${LOCALIZE} \
TILES=${TILES} \
SOUND=${SOUND} \
includes

tidyable_cpp_files="$( \
Expand Down

0 comments on commit b36cbc7

Please sign in to comment.