-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (116 loc) · 3.8 KB
/
ci.yaml
File metadata and controls
140 lines (116 loc) · 3.8 KB
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
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Qt for Linux and Windows
uses: jurplel/install-qt-action@v4
if: matrix.os != 'macOS-latest'
with:
version: '5.15.2'
host: ${{ matrix.os == 'windows-latest' && 'windows' || 'linux' }}
target: 'desktop'
arch: ${{ matrix.os == 'windows-latest' && 'win64_msvc2019_64' || 'gcc_64' }}
- name: Install Qt for macOS
if: matrix.os == 'macOS-latest'
run: |
brew install qt@5
echo "Qt5_DIR=$(brew --prefix qt@5)/lib/cmake" >> $GITHUB_ENV
echo "QT_PLUGIN_PATH=$(brew --prefix qt@5)/plugins" >> $GITHUB_ENV
echo "QML2_IMPORT_PATH=$(brew --prefix qt@5)/qml" >> $GITHUB_ENV
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y build-essential cmake libgl1-mesa-dev libxcb1-dev libxkbcommon-x11-dev libxcb-cursor0
- name: Install dependencies on macOS
if: matrix.os == 'macOS-latest'
run: |
brew install cmake
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: |
choco install cmake ninja
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
- name: Build project
run: |
cmake --build ${{github.workspace}}/build --config Release
- name: Run tests
run: |
cd ${{github.workspace}}/build && ctest --output-on-failure -C Release
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Upload build artifacts (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: app-${{ matrix.os }}
path: target/
clang-tidy:
name: Run clang-tidy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
- name: Install clang-tidy
run: |
sudo apt update
sudo apt install -y clang-tidy cmake
- name: Configure CMake with clang-tidy
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_CLANG_TIDY="clang-tidy"
- name: Build project with clang-tidy
run: |
cmake --build ${{github.workspace}}/build --config Release
continue-on-error: true
- name: Run clang-tidy analysis
run: |
find src/ -name "*.cpp" -o -name "*.h" | xargs clang-tidy -p ${{github.workspace}}/build
memory-analysis:
name: Memory analysis with Valgrind
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
- name: Install Valgrind
run: |
sudo apt update
sudo apt install -y valgrind cmake
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug
- name: Build project
run: |
cmake --build ${{github.workspace}}/build --config Debug
- name: Run tests with Valgrind
run: |
cd ${{github.workspace}}/build && find . -name "*test*" -executable -type f -exec valgrind --leak-check=full --error-exitcode=1 {} \; || true