File: clang-tidy.yml

package info (click to toggle)
cppcheck 2.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,924 kB
  • sloc: cpp: 274,396; python: 22,429; ansic: 8,103; sh: 1,094; makefile: 1,041; xml: 987; cs: 291
file content (93 lines) | stat: -rw-r--r-- 2,933 bytes parent folder | download
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
91
92
93
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: clang-tidy

on:
  push:
    branches:
      - 'main'
      - 'releases/**'
      - '2.*'
    tags:
      - '2.*'
  pull_request:
  schedule:
    - cron: '0 0 * * 0'
  workflow_dispatch:

permissions:
  contents: read

jobs:
  build:

    runs-on: ubuntu-22.04

    env:
      QT_VERSION: 6.10.0

    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false

      - name: Install missing software
        run: |
          sudo apt-get update
          sudo apt-get install -y cmake make
          sudo apt-get install -y libpcre3-dev
          sudo apt-get install -y libgl-dev  # fixes missing dependency for Qt in CMake

      - name: Install clang
        run: |
          sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
          wget https://apt.llvm.org/llvm.sh
          chmod +x llvm.sh
          sudo ./llvm.sh 22
          sudo apt-get install -y clang-tidy-22

      - name: Install Qt ${{ env.QT_VERSION }}
        uses: jurplel/install-qt-action@v4
        with:
          version: ${{ env.QT_VERSION }}
          modules: 'qtcharts'
          setup-python: 'false'
          install-deps: false
          cache: true

      - name: Verify clang-tidy configuration
        run: |
          clang-tidy-22 --verify-config

      - name: Prepare CMake
        run: |
          cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_COMPILE_WARNING_AS_ERROR=On
        env:
          CC: clang-22
          CXX: clang++-22

      - name: Prepare CMake dependencies
        run: |
          # make sure the auto-generated GUI sources exist
          make -C cmake.output autogen
          # make sure the precompiled headers exist
          make -C cmake.output/cli cmake_pch.hxx.pch
          make -C cmake.output/gui cmake_pch.hxx.pch
          make -C cmake.output/lib cmake_pch.hxx.pch
          make -C cmake.output/test cmake_pch.hxx.pch

      - name: Clang-Tidy
        if: ${{ github.event.schedule == '' && github.event_name != 'workflow_dispatch' }}
        run: |
          cmake --build cmake.output --target run-clang-tidy 2> /dev/null

      - name: Clang Static Analyzer
        if: ${{ github.event.schedule != '' || github.event_name == 'workflow_dispatch' }}
        run: |
          cmake --build cmake.output --target run-clang-tidy-csa 2> /dev/null

      - uses: actions/upload-artifact@v4
        if: success() || failure()
        with:
          name: Compilation Database
          path: ./cmake.output/compile_commands.json