-
Notifications
You must be signed in to change notification settings - Fork 34
90 lines (81 loc) · 3 KB
/
static_analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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