[ci] Fix ci #1697
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Static Analysis | |
on: | |
push: | |
pull_request: | |
types: [opened] | |
jobs: | |
clang-tidy: | |
name: Clang Tidy | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' && !github.event.pull_request.merged || github.event_name == 'push' }} | |
container: ubuntu:rolling | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
INEXOR_VULKAN_VERSION: "1.3.283.0" | |
INEXOR_VULKAN_SDK_PATH: "$GITHUB_WORKSPACE/../vulkan_sdk/" | |
INEXOR_VULKAN_SDK_CHECKSUM_LINUX: "8005e2cf3e89c80cbe1c0d0a259c88248de3257b4fc6fdefb47409edb3e43ecb" | |
steps: | |
- name: Update environment | |
run: | | |
# Update package lists | |
apt update -qq | |
# Install tools | |
apt-get install -y \ | |
clang-tidy \ | |
cmake \ | |
curl \ | |
git \ | |
libgl1-mesa-dev \ | |
libx11-dev \ | |
libx11-xcb-dev \ | |
libxcb-dri3-dev \ | |
libxcb-icccm4-dev \ | |
libxcb-image0-dev \ | |
libxcb-keysyms1-dev \ | |
libxcb-randr0-dev \ | |
libxcb-render-util0-dev \ | |
libxcb-render0-dev \ | |
libxcb-shape0-dev \ | |
libxcb-sync-dev \ | |
libxcb-util-dev \ | |
libxcb-xfixes0-dev \ | |
libxcb-xinerama0-dev \ | |
libxcb-xkb-dev \ | |
ninja-build \ | |
parallel \ | |
pkg-config \ | |
python3 \ | |
python3-pip \ | |
xkb-data \ | |
xorg-dev | |
pip3 install --break-system-packages wheel setuptools | |
- name: Install Vulkan SDK | |
shell: bash | |
run: | | |
curl -LS -o vulkansdk.tar.xz https://sdk.lunarg.com/sdk/download/${{ env.INEXOR_VULKAN_VERSION }}/linux/vulkansdk-linux-x86_64-${{ env.INEXOR_VULKAN_VERSION }}.tar.xz | |
echo "${{ env.INEXOR_VULKAN_SDK_CHECKSUM_LINUX }} vulkansdk.tar.xz" | sha256sum --check | |
mkdir -p ${{ env.INEXOR_VULKAN_SDK_PATH }} | |
tar xf vulkansdk.tar.xz -C "${{ env.INEXOR_VULKAN_SDK_PATH }}" | |
rm -rf vulkansdk.tar.xz | |
# runtime depenedencies | |
apt-get -y install qtbase5-dev libxcb-xinput0 libxcb-xinerama0 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure CMake | |
run: | | |
export CC=gcc | |
export CXX=g++ | |
export VULKAN_SDK="${{ env.INEXOR_VULKAN_SDK_PATH }}/${{ env.INEXOR_VULKAN_VERSION }}/x86_64" | |
export PATH=$VULKAN_SDK/bin:$PATH | |
export LD_LIBRARY_PATH=$VULKAN_SDK/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} | |
export VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d | |
cmake . -Bbuild -DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
- name: Run clang-tidy | |
run: | | |
find example src include -path '*/_deps/*' -prune -o \ | |
-name '*.cpp' -o -name '*.hpp' \ | |
-print0 | | |
parallel -0 \ | |
clang-tidy -p build --quiet {} 2>/dev/null | | |
tee output | |
if [ -s output ]; then exit 1; fi |