-
Notifications
You must be signed in to change notification settings - Fork 770
279 lines (265 loc) · 8.99 KB
/
ci.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
unix-like:
strategy:
fail-fast: false
matrix:
runs-on: [ ubuntu-24.04, macos-14 ]
compiler: [ 'gcc' ] # Only used on linux
libclang: [ true ] # Only used on linux
benchmark: [ true, false ]
include:
- runs-on: ubuntu-24.04
compiler: 'clang'
benchmark: false
libclang: true
name_suffix: 'with Clang compiler - '
- runs-on: ubuntu-24.04
compiler: 'gcc'
benchmark: false
libclang: false
name_suffix: 'without libclang completer - '
env:
USE_CLANG_COMPLETER: ${{ matrix.libclang }}
COVERAGE: ${{ !matrix.benchmark }}
name: "${{ matrix.runs-on }} - ${{ matrix.name_suffix }}${{ matrix.benchmark && 'C++ Benchmark' || 'test run' }}"
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v4
if: matrix.libclang == true && matrix.benchmark == false
with:
key: v3-libclang-${{ runner.os }}-${{ hashFiles( 'cpp/ycm/CMakeLists.txt' ) }}
restore-keys: |
v3-libclang-${{ runner.os }}-
v2-libclang-${{ runner.os }}-${{ hashFiles( 'cpp/ycm/CMakeLists.txt' ) }}
v2-libclang-${{ runner.os }}-
v1-libclang-${{ runner.os }}-
path: |
clang_archives
name: Cache libclang
- uses: actions/cache@v4
if: matrix.benchmark == false
with:
key: v2-deps-${{ runner.os }}-${{ hashFiles( 'build.py' ) }}
restore-keys: |
v2-deps-${{ runner.os }}-
v1-deps-${{ runner.os }}-
path: |
third-party/clangd/cache
third_party/eclipse.jdt.ls/target/cache
third_party/go
third_party/omnisharp-roslyn/v[0-9]*
name: Cache dependencies
- uses: actions/cache@v4
if: matrix.benchmark == false
with:
key: v2-testdeps-${{ runner.os }}-${{ hashFiles( 'run_tests.py' ) }}
restore-keys: |
v2-testdeps-${{ runner.os }}-
v1-testdeps-${{ runner.os }}-
path: |
third-party/lombok/cache
~/.npm
name: Cache test deps
- name: Install Java
if: matrix.benchmark == false
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Go
if: matrix.benchmark == false
uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Install mono
if: runner.os == 'Linux' && matrix.benchmark == false
run: |
sudo apt-get update
sudo apt-get install mono-complete
- name: Install GCC
if: runner.os == 'Linux' && matrix.compiler != 'clang'
run: |
sudo apt-get update
sudo apt-get install gcc-10 g++-10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-10 100
- name: Install Clang
if: runner.os == 'Linux' && matrix.compiler == 'clang'
run: |
sudo apt-get update
sudo apt-get install clang-14
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-14 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-14 100
- name: Run pip and prepare coverage
if: matrix.benchmark == false
run: |
python3 -m pip install -r test_requirements.txt
echo -e "import coverage\ncoverage.process_startup()" > $(python -c "print(__import__('sysconfig').get_path('purelib'))")/sitecustomize.py
- name: Run tests
if: matrix.benchmark == false
run: python3 run_tests.py --quiet
- name: Run benchmarks
if: matrix.benchmark == true
run: python3 benchmark.py --quiet
- name: Combine and summarise coverage
if: matrix.benchmark == false
run: coverage combine && coverage xml
- name: Upload coverage data
uses: codecov/codecov-action@v4
if: matrix.benchmark == false
with:
name: "${{ matrix.runs-on }}-${{ matrix.name_suffix }}-tests"
token: ${{ secrets.CODECOV_TOKEN }}
gcov: true
linux_lint:
name: "C++ Lint"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install Python
uses: deadsnakes/[email protected]
with:
python-version: '3.13'
debug: true
- name: Install GCC
run: |
sudo apt-get update
sudo apt-get install gcc-10 g++-10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-10 100
- name: Install clang-tidy
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y clang-tidy libc6-dbg build-essential
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 100
- name: Install valgrind
run: |
sudo apt-get update
sudo apt-get install valgrind
- name: Run pip
run: python3 -m pip install -r test_requirements.txt
- name: Lint
run: |
YCM_TESTRUN=1 python3 build.py --clang-completer --clang-tidy --valgrind
python3 run_tests.py --valgrind --skip-build --no-flake8 --quiet
windows:
strategy:
fail-fast: false
matrix:
runs-on: [ windows-2022 ]
benchmark: [ true, false ]
python-arch: [ 'x64', 'x86' ]
msvc: [ 17 ]
exclude:
- runs-on: windows-2022
benchmark: true
python-arch: 'x86'
include:
- runs-on: windows-2019
benchmark: false
python-arch: 'x64'
msvc: 16
runs-on: ${{ matrix.runs-on }}
env:
USE_CLANG_COMPLETER: ${{ matrix.libclang }}
COVERAGE: ${{ !matrix.benchmark }}
name: "Windows MSVC ${{ matrix.msvc }} ${{ matrix.python-arch }} - ${{ matrix.benchmark && 'C++ Benchmark' || 'test run' }}"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v4
if: matrix.libclang == true && matrix.benchmark == false
with:
key: v3-libclang-${{ runner.os }}-${{ hashFiles( 'cpp/ycm/CMakeLists.txt' ) }}
restore-keys: |
v3-libclang-${{ runner.os }}-
v2-libclang-${{ runner.os }}-${{ hashFiles( 'cpp/ycm/CMakeLists.txt' ) }}
v2-libclang-${{ runner.os }}-
v1-libclang-${{ runner.os }}-
path: |
clang_archives
name: Cache libclang
- uses: actions/cache@v4
if: matrix.benchmark == false
with:
key: v2-deps-${{ runner.os }}-${{ hashFiles( 'build.py' ) }}
restore-keys: |
v2-deps-${{ runner.os }}-
v1-deps-${{ runner.os }}-
path: |
third-party/clangd/cache
third_party/eclipse.jdt.ls/target/cache
third_party/go
third_party/omnisharp-roslyn/v[0-9]*
name: Cache dependencies
- uses: actions/cache@v4
if: matrix.benchmark == false
with:
key: v2-testdeps-${{ runner.os }}-${{ hashFiles( 'run_tests.py' ) }}
restore-keys: |
v2-testdeps-${{ runner.os }}-
v1-testdeps-${{ runner.os }}-
path: |
third-party/lombok/cache
~/.npm
name: Cache test deps
- name: Install Java
if: matrix.benchmark == false
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
architecture: ${{ matrix.python-arch }}
- name: Install Go
if: matrix.benchmark == false
uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Run pip and prepare coverage
if: matrix.benchmark == false
run: |
python3 -m pip install -r test_requirements.txt
echo -e "import coverage\ncoverage.process_startup()" > $(python -c "print(__import__('sysconfig').get_path('purelib'))")/sitecustomize.py
shell: bash
- name: Run benchmarks
if: matrix.benchmark == true
run: python3 benchmark.py --msvc ${{ matrix.msvc }} --quiet
- name: Run tests
if: matrix.benchmark == false
run: python3 run_tests.py --msvc ${{ matrix.msvc }} --quiet
- name: Combine and summarise coverage
if: matrix.benchmark == false
run: coverage combine && coverage xml
- name: Upload coverage data
uses: codecov/codecov-action@v4
if: matrix.benchmark == false
with:
name: "${{ matrix.runs-on }}-${{ matrix.name_suffix }}-tests"
token: ${{ secrets.CODECOV_TOKEN }}