-
Notifications
You must be signed in to change notification settings - Fork 66
51 lines (43 loc) · 2 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
name: Static analysis
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
clang-tidy-linux:
strategy:
fail-fast: false
matrix:
include:
- build_args: -DPLGD_DEV_TIME_ENABLED=ON -DPLGD_DEV_DEVICE_PROVISIONING_ENABLED=ON
- build_args: -DOC_DYNAMIC_ALLOCATION_ENABLED=OFF -DOC_PUSH_ENABLED=OFF -DOC_JSON_ENCODER_ENABLED=OFF -DOC_DEBUG_ENABLED=ON
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: "true"
- name: Install clang-17 and clang-tidy-17
run: |
sudo apt-get update -y
sudo apt-get install curl
curl -sL https://apt.llvm.org/llvm.sh > llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-17 clang-tidy-17
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 200
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-17 200
update-alternatives --verbose --display clang
- name: Build with clang and analyze with clang-tidy
run: |
mkdir build && cd build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DOC_CLANG_TIDY_ENABLED=ON -DOC_CLOUD_ENABLED=ON -DOC_COLLECTIONS_IF_CREATE_ENABLED=ON -DOC_MNT_ENABLED=ON -DOC_WKCORE_ENABLED=ON -DOC_SOFTWARE_UPDATE_ENABLED=ON -DOC_DISCOVERY_RESOURCE_OBSERVABLE_ENABLED=ON -DOC_PUSH_ENABLED=ON -DOC_RESOURCE_ACCESS_IN_RFOTM_ENABLED=ON -DOC_ETAG_ENABLED=ON -DOC_JSON_ENCODER_ENABLED=ON ${{ matrix.build_args }} -DBUILD_TESTING=OFF ..
cmake --build .