-
Notifications
You must be signed in to change notification settings - Fork 524
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
236 lines (221 loc) · 9.9 KB
/
.gitlab-ci.yml
File metadata and controls
236 lines (221 loc) · 9.9 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
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
# Copyright 2018-2026 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
# Gitlab CI file for vulkan spec and header generation
# All stages use the same Docker image, so there are no prerequisites
# Refer to the container by its SHA instead of the name, to prevent
# caching problems when updating the image.
# image: khronosgroup/docker-images:asciidoctor-spec.202506
# There are no 'before_script' tags for most stages, because all
# prerequisites are in the default image.
image: khronosgroup/docker-images@sha256:f1ca671f3bdb10ad49e238b9bf28853088a21af49504498fc9084c9b4fea4762
# Specify which gitlab runner to use
default:
tags:
- khrmedium
# Verify repository license compliance
license-check:
stage: build
script:
- reuse lint
allow_failure: false
# Run consistency checks on the spec and XML sources
# Separate from the generate step to set allow_failure: false
consistency-check:
stage: build
script:
# Internal self-test of the check_spec_links script
- ( cd scripts && pytest test*.py )
- mkdir -p gen/out/checks
# Generate a summary of problems for CI logs (if any)
# Override CHECK_XREFS to avoid building a redundant HTML target at this stage
- python3 scripts/check_spec_links.py --html=gen/out/checks/problems.html > /dev/null || true
- make CHECK_XREFS= allchecks
allow_failure: false
# Check (only in main branch) for PROPOSED or UNRESOLVED issues in
# appendices
proposed-check:
stage: build
script:
- make check-proposed
rules:
- if: $CI_COMMIT_BRANCH =~ /main/
# Consistency check for extension development branches
# First verify that SPEC_VERSION >= 1 (-test argument)
# Then verify that core + extension spec builds for extension development
# branches (-build argument)
# This only runs on merge requests where CI_COMMIT_BRANCH is defined, and is
# a valid extension name, or is mapped to one in an exception list in
# scripts/testSpecVersion.py
spec_extension_branch_check:
stage: build
script:
- python3 scripts/testSpecVersion.py -branch "$CI_COMMIT_BRANCH" -test -build
allow_failure: false
# Build a test spec and check against expectation, to make sure the spec toolchain works as expected
spec-toolchain:
stage: build
script:
- ./testBuild
# Build the vulkan specification and generate any associated files (such as vulkan.h)
spec-generate:
stage: build
script:
- NODE_PATH="/usr/lib/node_modules"
- export NODE_PATH
# Validate the XML before building anything using it
- make -C xml validate
# Build the core-only spec, to catch incorrect ifdef errors
- ./makeSpec -clean -spec core -genpath gencore QUIET= -j${nproc} -Otarget html
# Build the ratified-only spec, to catch incorrect ifdef errors affecting ratification submissions
- ./makeSpec -clean -spec ratified -genpath genrat QUIET= -j${nproc} -Otarget html
# Build the all-extensions spec as published in the registry, with other common targets
# The spec, refpages, and auxiliary documents are built first and the
# build log checked for asciidoctor warnings that cannot be made into
# fatal errors.
- ./makeSpec -clean -spec all QUIET= -j${nproc} -Otarget html manhtmlpages styleguide registry |& tee ERRS
- |+
if fgrep -q 'WARNING: skipping reference to missing attribute:' ERRS
then
echo 'Found missing (undefined) asciidoctor attributes.'
echo 'These are probably from commonvalidity includes where attributes are not defined.'
echo 'If these are reported from building a refpage, edit the corresponding part of'
echo 'the specification source to fix the problem.'
echo '----'
fgrep -B 1 'WARNING: skipping reference to missing attribute:' ERRS
false
else
true
fi
# Build the rest of the targets, without cleaning the output directory
- ./makeSpec -spec all QUIET= -j${nproc} -Otarget validusage
# Check consistency of internal xrefs and anchors in the HTML output
- make check-xrefs
# Build headers, for use by all later stages
- make -C xml install test vtest
artifacts:
when: always
paths:
- src/
- gencore/
- genrat/
- gen/
expire_in: 1 week
# Build the vulkan sc specification and generate any associated files (such as vulkan_sc_core.h)
vksc-generate:
stage: build
script:
- NODE_PATH="/usr/lib/node_modules"
- export NODE_PATH
- VULKAN_API="vulkansc"
- export VULKAN_API
# Build the all-extensions spec as published in the registry, with other common targets
- ./makeSpec -clean -spec all -version sc1.0 -genpath genvksc QUIET= -j${nproc} -Otarget manhtmlpages validusage styleguide registry html
# Check consistency of internal xrefs and anchors in the output, now
# that an HTML output is available
#- make check-xrefs
# Build headers, for use by all later stages
- ( cd xml && make GENERATED=../genvksc validate install test )
artifacts:
when: always
paths:
- genvksc/
expire_in: 1 week
allow_failure: true
# Generate the vulkan base specification and generate any associated files (such as vulkan_base.h)
vulkanbase-generate:
stage: build
script:
- NODE_PATH="/usr/lib/node_modules"
- export NODE_PATH
- VULKAN_API="vulkanbase"
- export VULKAN_API
# Build the actual spec HTML, and other common targets
- ./makeSpec -clean -spec all -version vkb1.4 -genpath genvkb QUIET= -j${nproc} -Otarget manhtmlpages validusage styleguide registry html
- ./makeSpec -clean -spec all -version vkc1.4 -genpath genvkc QUIET= -j${nproc} -Otarget manhtmlpages validusage styleguide registry html
- ./makeSpec -clean -spec all -version vkg1.4 -genpath genvkg QUIET= -j${nproc} -Otarget manhtmlpages validusage styleguide registry html
# Check consistency of internal xrefs and anchors in the output, now
# that an HTML output is available
#- make check-xrefs
# Build headers, for use by all later stages
- ( cd xml && make GENERATED=../genvkb install test GENOPTS="-feature VK_BASE_VERSION_1_0 -feature VK_BASE_VERSION_1_1 -feature VK_BASE_VERSION_1_2 -feature VK_BASE_VERSION_1_3 -feature VK_BASE_VERSION_1_4 -emitExtensions '^$$'" )
- ( cd xml && make GENERATED=../genvkc install test GENOPTS="-feature VK_BASE_VERSION_1_0 -feature VK_COMPUTE_VERSION_1_0 -feature VK_BASE_VERSION_1_1 -feature VK_COMPUTE_VERSION_1_1 -feature VK_BASE_VERSION_1_2 -feature VK_COMPUTE_VERSION_1_2 -feature VK_BASE_VERSION_1_3 -feature VK_COMPUTE_VERSION_1_3 -feature VK_BASE_VERSION_1_4 -feature VK_COMPUTE_VERSION_1_4 -emitExtensions '^$$'" )
- ( cd xml && make GENERATED=../genvkg install test GENOPTS="-feature VK_BASE_VERSION_1_0 -feature VK_COMPUTE_VERSION_1_0 -feature VK_GRAPHICS_VERSION_1_0 -feature VK_BASE_VERSION_1_1 -feature VK_COMPUTE_VERSION_1_1 -feature VK_GRAPHICS_VERSION_1_1 -feature VK_BASE_VERSION_1_2 -feature VK_COMPUTE_VERSION_1_2 -feature VK_GRAPHICS_VERSION_1_2 -feature VK_BASE_VERSION_1_3 -feature VK_COMPUTE_VERSION_1_3 -feature VK_GRAPHICS_VERSION_1_3 -feature VK_BASE_VERSION_1_4 -feature VK_COMPUTE_VERSION_1_4 -feature VK_GRAPHICS_VERSION_1_4 -emitExtensions '^$$'" )
artifacts:
when: always
paths:
- genvkb/
- genvkc/
- genvkg/
expire_in: 1 weeks
allow_failure: true
# Generate the vulkan C++ header (vulkan.hpp)
hpp-generate:
stage: build
before_script:
- SPEC_DIR="${PWD}"
- cd /tmp
- rm -rf Vulkan-Hpp
- git clone https://github.com/KhronosGroup/Vulkan-Hpp.git
- cd Vulkan-Hpp
- git submodule update --init --recursive -- tinyxml2
- rm -rf Vulkan-Docs
- cp -r "${SPEC_DIR}" Vulkan-Docs
# Copy Vulkan C headers into subdir copy used by Vulkan-Hpp
- cp -p ${SPEC_DIR}/include/vulkan/*.h Vulkan-Docs/include/vulkan/
script:
- cd /tmp/Vulkan-Hpp
- cmake -H. -Bbuild
- make -C build
- cd build
- ./VulkanHppGenerator -f "${SPEC_DIR}"/xml/vk.xml
after_script:
- mkdir -p Vulkan-Hpp/vulkan/
- cp /tmp/Vulkan-Hpp/vulkan/*.hpp Vulkan-Hpp/vulkan/
artifacts:
paths:
- Vulkan-Hpp/vulkan/
expire_in: 1 week
allow_failure: true
# Run the CTS Vulkan framework tests, to make sure XML changes will not
# cause problems there.
cts-framework-tests:
stage: build
script:
# Clone the CTS GitHub repository.
# Use sparse / shallow clone since the repo is enormous and mostly not needed for these tests
- git clone --sparse --depth 1 --single-branch --branch main https://github.com/KhronosGroup/VK-GL-CTS.git
- cd VK-GL-CTS
# Add sparse checkout paths for required directories
- git sparse-checkout add scripts external/vulkancts/framework external/vulkancts/scripts
# Link the spec project into CTS hierarchy, instead of cloning it
- mkdir external/vulkan-docs
- ln -s `cd .. ; pwd` external/vulkan-docs/src
# Run the Vulkan-specific tests (from scripts/check_build_sanity.py) # codespell:allow sanity
- python3 external/vulkancts/scripts/gen_framework.py
- python3 external/vulkancts/scripts/gen_framework_c.py
- python3 external/vulkancts/scripts/gen_framework.py --api SC
- python3 external/vulkancts/scripts/gen_framework_c.py --api SC
allow_failure: true
# Compile a simple test program that uses vulkan.h
# The fake platform headers in tests/ allow compiling with all Vulkan
# platforms at once.
h-compile:
stage: test
needs:
- spec-generate
script:
- gcc -c -std=c11 -Igen/include -Itests -Wall -Wextra -Werror tests/htest.c
- clang -c -std=c11 -Igen/include -Itests -Wall -Wextra -Werror tests/htest.c
# Compile a simple test program that uses vulkan.hpp
hpp-compile:
stage: test
needs:
- spec-generate
- hpp-generate
parallel:
matrix:
- cpp_standard: [c++11, c++14, c++17, c++20]
script:
- g++ -c -std=$cpp_standard -Igen/include -IVulkan-Hpp -Wall -Wextra -Werror -Wpedantic tests/hpptest.cpp
- clang++ -c -std=$cpp_standard -Igen/include -IVulkan-Hpp -Wall -Wextra -Werror -Wpedantic tests/hpptest.cpp
allow_failure: true