Skip to content

feat(content, port): Port Directed push from DDA #8755

feat(content, port): Port Directed push from DDA

feat(content, port): Port Directed push from DDA #8755

Workflow file for this run

name: Clang-tidy (tiles)
on:
# push:
# branches: [main]
# paths: [ "**.cpp", "**.h", "**.c", "**/CMakeLists.txt", "**/Makefile", "**.hpp", "**.cmake", "build-scripts/**","tools/clang-tidy-plugin/**", ".github/workflows/clang-tidy.yml", "**/.clang-tidy" ]
pull_request:
branches: [main]
paths: [ "**.cpp", "**.h", "**.c", "**/CMakeLists.txt", "**/Makefile", "**.hpp", "**.cmake", "build-scripts/**", "tools/clang-tidy-plugin/**", ".github/workflows/clang-tidy.yml", "**/.clang-tidy" ]
# We only care about the latest revision of a PR, so cancel all previous instances.
concurrency:
group: clang-tidy-build-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
jobs:
skip-duplicates:
continue-on-error: true
runs-on: ubuntu-24.04
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: "true"
paths: '[ "**.cpp", "**.h", "**.c", "**/CMakeLists.txt", "**/Makefile", "**.hpp", "**.cmake", "build-scripts/**", "tools/clang-tidy-plugin/**", ".github/workflows/clang-tidy.yml", "**/.clang-tidy" ]'
build:
needs: skip-duplicates
if: ${{ needs.skip-duplicates.outputs.should_skip != 'true' }}
runs-on: ubuntu-24.04
env:
CMAKE: 1
CLANG: /usr/bin/clang++-18
COMPILER: /usr/bin/clang++-18
TILES: 1
SOUND: 1
BUILD_PATH: "build"
AFFECTED_FILES: "affected_files.txt"
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install \
cmake gettext ninja-build mold ccache jq \
clang-18 libclang-18-dev llvm-18 llvm-18-dev clang-tidy-18 \
libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libpulse-dev libflac-dev
- name: ensure clang 18 is installed
run: |
if [ -z "$(command -v clang++-18)" ]; then
echo "clang 18 not found"
exit 1
fi
ls -al /usr/lib/llvm-18/lib
if [ ! -d /usr/lib/llvm-18/lib ]; then
echo "llvm-18 not found"
exit 1
fi
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
sudo update-alternatives --install /usr/bin/FileCheck FileCheck /usr/bin/FileCheck-18 100
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
install_ccache: false
update_packager_index: false
- name: add problem matcher
run: |
# Enable GitHub actions problem matchers
# (See https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md)
echo "::add-matcher::build-scripts/problem-matchers/catch2.json"
echo "::add-matcher::build-scripts/problem-matchers/debugmsg.json"
- uses: ammaraskar/gcc-problem-matcher@master
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: build clang-tidy plugin
run: |
pip install --break-system-packages lit
bash ./build-scripts/build-clang-tidy-plugin.sh
# - name: test clang-tidy plugin
# run: |
# lit -v $BUILD_PATH/tools/clang-tidy-plugin/test
# clang-tidy --version
- name: gather affected files
run: deno task affected-files ${{ github.event.pull_request.number }} --output "$AFFECTED_FILES"
- name: run clang-tidy
run: bash ./build-scripts/run-clang-tidy-plugin.sh
- name: show most time consuming checks
if: always()
run: | # the folder may not exist if there is no file to analyze
if [ -d clang-tidy-trace ]
then
jq -n 'reduce(inputs.profile | to_entries[]) as {$key,$value} ({}; .[$key] += $value) | with_entries(select(.key|contains(".wall"))) | to_entries | sort_by(.value) | reverse | .[0:10] | from_entries' clang-tidy-trace/*.json
else
echo "clang-tidy-trace folder not found."
fi