forked from KhronosGroup/Vulkan-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
130 lines (121 loc) · 4.58 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
# Copyright 2018-2021 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
image: khronosgroup/docker-images:asciidoctor-spec
# Verify repository license compliance
license-check:
stage: build
before_script:
# Nothing, all prerequisites are in the Docker image
script:
- reuse lint
allow_failure: false
# Check for bad terminology and markup
# check_undefined looks for untagged use of 'undefined' in spec sources
# reflow.py looks for asciidoctor conditionals inside VU statements,
# and for duplicated VUID numbers, but only in spec sources.
# xml_consistency.py performs various XML consistency checks
terminology_check:
stage: build
before_script:
# Nothing, all prerequisites are in the Docker image
script:
- scripts/ci/check_undefined
- scripts/reflow.py -nowrite -noflow -check FAIL -checkVUID FAIL chapters/*txt chapters/*/*txt appendices/*txt
- scripts/xml_consistency.py
allow_failure: false
# Verify SPEC_VERSION = 1 for extension development branches
# This only runs on merge requests
spec_version_check:
stage: build
before_script:
# Nothing, all prerequisites are in the Docker image
script:
# Only run the test if CI_COMMIT_BRANCH is defined
- test -z "$CI_COMMIT_BRANCH" || scripts/testSpecVersion.py -branch $CI_COMMIT_BRANCH
allow_failure: false
# Build the vulkan specification and generate any associated files (such as vulkan.h)
spec-generate:
stage: build
before_script:
# Nothing, all prerequisites are in the Docker image
script:
- NODE_PATH="/usr/lib/node_modules"
- export NODE_PATH
# Internal self-test of the check_spec_links script
- ( cd scripts && py.test-3 test*.py )
- mkdir -p gen/out/checks
- scripts/check_spec_links.py --html=gen/out/checks/problems.html > /dev/null || true
# Breaking the build if # of errors increases. We should manually ratchet ignore_count down as errors get fixed.
# If there are unfixable errors, add '--ignore_count #' where '#' is the
# number of them. This is a slightly crude way of enforcing "don't add
# errors" but simpler than the alternatives (running against default branch,
# diff, etc)
- scripts/check_spec_links.py -Werror --ignore_count 0
# Build the actual spec (both chunked and single-page HTML), and other common targets
- ./makeSpec -clean -spec all QUIET= -j${nproc} -Otarget manhtmlpages validusage styleguide registry chunked html
# Build the core-only spec, to try and catch ifdef errors in extension markup
- ./makeSpec -clean -spec core -genpath gencore QUIET= -j${nproc} -Otarget chunked html
# Build headers, for use by all later stages
- ( cd xml && make validate test install )
artifacts:
when: always
paths:
- src/
- gen/
- gencore/
expire_in: 1 week
# 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 "${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
# 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
dependencies:
- spec-generate
before_script:
# Nothing, all prerequisites are in the Docker image
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
dependencies:
- spec-generate
- hpp-generate
before_script:
# Nothing, all prerequisites are in the Docker image
script:
- g++ -c -std=c++11 -Igen/include -IVulkan-Hpp -Wall -Wextra -Werror tests/hpptest.cpp
- clang++ -c -std=c++11 -Igen/include -IVulkan-Hpp -Wall -Wextra -Werror tests/hpptest.cpp
allow_failure: true