forked from KhronosGroup/SPIRV-Headers
-
Notifications
You must be signed in to change notification settings - Fork 1
153 lines (141 loc) · 5.05 KB
/
presubmit.yml
File metadata and controls
153 lines (141 loc) · 5.05 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
name: Presubmit
on: [push, pull_request]
permissions:
contents: read
jobs:
validate_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Validate
run: python3 tools/check_grammar/check_grammar.py include/spirv/unified1/*.json
build:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Install Ubuntu packages
if: matrix.os == 'ubuntu-latest'
run: sudo apt install -y dos2unix
- name: Install macOS packages
if: matrix.os == 'macos-latest'
run: brew install dos2unix
- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=install ..
cmake --build . --target install
- name: Build spec tools
run: |
cd tools/buildHeaders
mkdir build
cd build
cmake ..
cmake --build . --target install
- name: Build headers
run: |
cd tools/buildHeaders
./bin/makeHeaders
- name: Check generated headers
run: git diff --exit-code
- name: Check for legacy asciidoc in JSON
if: matrix.os == 'ubuntu-latest'
run: |
grep \"\'".*"\'\" include/spirv/unified1/*.json >build/bad-asciidoc.txt || true
if [ 0 -lt $(cat build/bad-asciidoc.txt | wc -l) ]; then
echo "Legacy asciidoc italics detected, like \"'foo'\". Text formating aren't used anymore. Please use \"foo\" instead."
head -10 build/bad-asciidoc.txt
exit 1
fi
test_cmake_min_required:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.14.0
- name: CMake build
run: |
cmake -S . -B build/ -D CMAKE_BUILD_TYPE=Debug -G "Ninja" -D CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/build/install/
cmake --build build --target install
test_cmake_latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: lukka/get-cmake@latest
- name: CMake build
run: |
cmake -S . -B build/ -D CMAKE_BUILD_TYPE=Debug -G "Ninja"
cmake --install build/ --prefix build/install
add_subdirectory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.15.0
- name: Build spirv-headers with testing enabled
run: |
cmake -S . -B build/ -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug -G "Ninja"
cmake --build build
find_package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.15.0
- name: Install spirv-headers
run: |
cmake -S . -B build/
cmake --install build/ --prefix build/install
- name: Check spirv-headers find_package support
run: |
cmake -S tests/find_package -B tests/find_package/build/ -D CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/build/install
cmake --build tests/find_package/build/
find_pkg_config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.15.0
- name: Install spirv-headers
run: |
cmake -S . -B build/ -D CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/build/install/
cmake --install build/
- name: Check spirv-headers pkg_config support
run: |
cmake -S tests/pkg_config -B tests/pkg_config/build/ -D CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/build/install
cmake --build tests/pkg_config/build/
# https://github.com/KhronosGroup/SPIRV-Headers/issues/282
find_pkg_config_absolute:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.15.0
- name: Install spirv-headers with CMAKE_INSTALL_INCLUDEDIR being absolute
run: |
cmake -S . -B build/ -D CMAKE_INSTALL_INCLUDEDIR=${GITHUB_WORKSPACE}/build/install/include -D CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/build/install/
cmake --install build/
- name: Check spirv-headers pkg_config support
run: |
cmake -S tests/pkg_config -B tests/pkg_config/build/ -D CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/build/install
cmake --build tests/pkg_config/build/
license-check:
name: Verify repository license compliance
runs-on: ubuntu-latest
# We now refer to the container by its SHA instead of the name, to prevent
# caching problems when updating the image.
# container: khronosgroup/docker-images:asciidoctor-spec.20240726
container: khronosgroup/docker-images@sha256:724f67d8562445523644abf017d5d192b369fafc122de75e9d26792c649821a0
steps:
- uses: actions/checkout@v6
- name: REUSE license checker
run: reuse lint