-
Notifications
You must be signed in to change notification settings - Fork 34
84 lines (76 loc) · 2.59 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
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.216.0"
INEXOR_VULKAN_SDK_PATH: "$GITHUB_WORKSPACE/../vulkan_sdk/"
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
run: |
# Download Vulkan SDK
curl -LS -o vulkansdk.tar.gz \
https://sdk.lunarg.com/sdk/download/${{ env.INEXOR_VULKAN_VERSION }}/linux/vulkansdk-linux-x86_64-${{ env.INEXOR_VULKAN_VERSION }}.tar.gz
# Create Vulkan SDK directory and extract
mkdir "${{ env.INEXOR_VULKAN_SDK_PATH }}"
tar xfz vulkansdk.tar.gz -C "${{ env.INEXOR_VULKAN_SDK_PATH }}"
- 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
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