-
Notifications
You must be signed in to change notification settings - Fork 24
156 lines (127 loc) · 5.34 KB
/
code-quality.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Code-Quality
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
env:
WORK_DIR: ${{github.workspace}}/JUCE_modules/chowdsp_utils
jobs:
clang_tidy:
name: "Run Code Quality Check: clang-tidy"
runs-on: ubuntu-22.04
steps:
- name: Install Linux Deps
run: |
sudo apt-get update
sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libsamplerate-dev
- name: Install clang-tidy
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14
sudo apt-get install clang-tidy-14
clang-tidy-14 --version
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{env.WORK_DIR}}
- name: Set up environment
working-directory: ${{github.workspace}}
run: |
git clone --depth 1 --branch 7.0.6 https://github.com/juce-framework/JUCE.git
cd JUCE_modules
git clone --single-branch --branch chowdsp https://github.com/Chowdhury-DSP/foleys_gui_magic.git
git clone --single-branch --branch main --recursive https://github.com/free-audio/clap-juce-extensions.git
- name: Configure
working-directory: ${{env.WORK_DIR}}
shell: bash
run: cmake -Bbuild -DCHOWDSP_ENABLE_TESTING=ON -DCHOWDSP_CODE_QUALITY_CHECKS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug
- name: Run clang-tidy
working-directory: ${{env.WORK_DIR}}
shell: bash
run: cmake --build build --parallel 4 --target chowdsp_utils_clang_tidy
sonar_scan:
name: "Run Code Quality Check: sonar-scan"
runs-on: ubuntu-22.04
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- name: Install Linux Deps
run: |
sudo apt-get update
sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libsamplerate-dev
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{env.WORK_DIR}}
fetch-depth: 0
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Set up environment
working-directory: ${{github.workspace}}
run: |
git clone --depth 1 --branch 7.0.1 https://github.com/juce-framework/JUCE.git
cd JUCE_modules
git clone --single-branch --branch chowdsp https://github.com/Chowdhury-DSP/foleys_gui_magic.git
git clone --single-branch --branch main --recursive https://github.com/free-audio/clap-juce-extensions.git
- name: Configure
working-directory: ${{env.WORK_DIR}}
shell: bash
run: cmake -Bbuild -DCHOWDSP_ENABLE_TESTING=ON -DCHOWDSP_CODE_QUALITY_CHECKS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{env.WORK_DIR}}
shell: bash
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build --parallel 4 --target chowdsp_utils_codeql
- name: Run sonar-scanner
working-directory: ${{env.WORK_DIR}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
code_ql:
name: "Run Code Quality Check: CodeQL"
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'push' }}
steps:
- name: Install Linux Deps
run: |
sudo apt-get update
sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libsamplerate-dev
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{env.WORK_DIR}}
fetch-depth: 0
- name: Set up environment
working-directory: ${{github.workspace}}
run: |
git clone --depth 1 --branch 7.0.1 https://github.com/juce-framework/JUCE.git
cd JUCE_modules
git clone --single-branch --branch chowdsp https://github.com/Chowdhury-DSP/foleys_gui_magic.git
git clone --single-branch --branch main --recursive https://github.com/free-audio/clap-juce-extensions.git
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
source-root: ${{env.WORK_DIR}}
languages: cpp
- name: Configure
working-directory: ${{env.WORK_DIR}}
shell: bash
run: cmake -Bbuild -DCHOWDSP_ENABLE_TESTING=ON -DCHOWDSP_CODE_QUALITY_CHECKS=ON -DCMAKE_BUILD_TYPE=Debug
- name: Build
working-directory: ${{env.WORK_DIR}}
shell: bash
run: cmake --build build --config Debug --parallel 4 --target chowdsp_utils_codeql
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2