-
Notifications
You must be signed in to change notification settings - Fork 68
/
.gitlab-ci.yml
168 lines (155 loc) · 4.4 KB
/
.gitlab-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
stages:
- Check
- Build
- Test
- Package
Doxygen:
stage: Check
image: $DOCKER_REGISTRY/docker/doxygen/linux:latest
tags:
- linux
- docker
script:
- mkdir -p doxygen
- doxygen docs/doxygen/doxyfile
- if [ $(stat -c%s doxygen/warnings.txt) -gt 0 ]; then cat doxygen/warnings.txt; exit 1; fi
CopyrightHeaders:
stage: Check
image: $DOCKER_REGISTRY/docker/copyright-check/linux:latest
tags:
- linux
- docker
script:
- python3 /usr/local/bin/check_copyright_headers.py $TARGET_BRANCH
SnakeCase:
stage: Check
image: $DOCKER_REGISTRY/docker/snake_case_check/linux:latest
tags:
- linux
- docker
script:
- git snake-case $TARGET_BRANCH > snake-report.txt
- if [ $(grep -c '@@' snake-report.txt) -gt 0 ]; then cat snake-report.txt; exit 1; fi
allow_failure: true
ClangFormat:
stage: Check
image: $DOCKER_REGISTRY/docker/cpp-code-check/linux:latest
tags:
- linux
- docker
script:
- git clang-format -v --diff $TARGET_BRANCH > clang-format-report.txt
- if [ $(grep -c 'clang-format did not modify any files' clang-format-report.txt) -eq 0 ] && [ $(grep -c 'no modified files to format' clang-format-report.txt) -eq 0 ]; then cat clang-format-report.txt; exit 1; fi
ClangTidy:
stage: Check
image: $DOCKER_REGISTRY/docker/cpp-code-check/linux:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- linux
- docker
script:
- cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -H. -Bbuild/clang
- python3 /usr/local/bin/run-clang-tidy.py -j $(($(nproc)/2+1)) -p build/clang -clang-tidy-binary=clang-tidy-8 -header-filter=framework,samples,vulkan_best_practice -checks=-*,google-*,-google-runtime-references -quiet framework/* samples/* vulkan_best_practice/* tests/*
Linux:
stage: Build
image: $DOCKER_REGISTRY/docker/vulkan-cookbook/linux:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- linux
- docker
artifacts:
paths:
- build/linux
expire_in: 2h
script:
- cmake -G "Unix Makefiles" -H. -Bbuild/linux -DCMAKE_BUILD_TYPE=Release -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON
- cmake --build build/linux --target vulkan_best_practice --config Release -- -j$(($(nproc)/2+1))
Windows:
stage: Build
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- windows
- shell
artifacts:
paths:
- build/windows
expire_in: 2h
script:
- cmake -G"Visual Studio 15 2017 Win64" -H. -Bbuild/windows -DVKB_BUILD_TESTS:BOOL=ON -DVKB_BUILD_SAMPLES:BOOL=ON
- cmake --build build/windows --target vulkan_best_practice --config Release
Android:
stage: Build
image: $DOCKER_REGISTRY/docker/vulkan-cookbook/linux-android:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- linux
- docker
artifacts:
paths:
- build/android
expire_in: 2h
script:
- cmake -G "Unix Makefiles" -H. -Bbuild/android -DCMAKE_TOOLCHAIN_FILE=bldsys/toolchain/android_gradle.cmake -DVKB_BUILD_TESTS=ON -DVKB_BUILD_SAMPLES=ON
- cmake --build build/android --config Release --target vulkan_best_practice_package -- -j$(($(nproc)/2+1))
GenerateSample:
stage: Test
variables:
GIT_SUBMODULE_STRATEGY: recursive
dependencies:
- Windows
tags:
- windows
- shell
script:
- cd tests/generate_sample
- python generate_sample_test.py
SystemTest:
stage: Test
variables:
GIT_SUBMODULE_STRATEGY: recursive
artifacts:
paths:
- tests/system_test/artifacts
expire_in: 1d
when: on_failure
dependencies:
- Windows
tags:
- windows
- shell
script:
- cd tests/system_test
- python system_test.py -Bbuild/windows -Crelease -D -P
LinuxExternalProject:
stage: Package
image: $DOCKER_REGISTRY/docker/vulkan-cookbook/linux:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- linux
- docker
script:
- cmake -Htests/external_project -Bbuild -DVKB_BUILD_SAMPLES=OFF
WindowsExternalProject:
stage: Package
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- windows
- shell
script:
- cmake -Htests/external_project -Bbuild -DVKB_BUILD_SAMPLES=OFF
AndroidExternalProject:
stage: Package
image: $DOCKER_REGISTRY/docker/vulkan-cookbook/linux-android:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- linux
- docker
script:
- cmake -DCMAKE_TOOLCHAIN_FILE=../../bldsys/toolchain/android_gradle.cmake -Htests/external_project -Bbuild -DVKB_BUILD_SAMPLES=OFF