-
Notifications
You must be signed in to change notification settings - Fork 566
152 lines (127 loc) · 4.75 KB
/
main.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
# Copyright 2020-2021 The Khronos Group, Inc.
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
name: "Build ${{ matrix.platform }}"
strategy:
matrix:
platform: [windows-latest, ubuntu-20.04, ubuntu-22.04, macos-latest]
env:
PARALLEL: -j 2
runs-on: "${{ matrix.platform }}"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Cache glslang / SPIRV-Tools
id: cache-externals
uses: actions/cache@v3
with:
path: external/*-build/output
key: ${{ matrix.platform }} externals ${{ hashFiles('checkout_glslang_spirv_tools.sh', 'build_glslang_spirv_tools.sh') }}
- name: Pull glslang / SPIRV-Tools
if: steps.cache-externals.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{github.workspace}}
run: ./checkout_glslang_spirv_tools.sh
- name: Build glslang / SPIRV-Tools
if: steps.cache-externals.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{github.workspace}}
run: ./build_glslang_spirv_tools.sh Release 4
- name: Configure SPIRV-Cross
shell: bash
run: |
mkdir build
cd build
cmake .. -DSPIRV_CROSS_WERROR=ON -DSPIRV_CROSS_MISC_WARNINGS=ON -DSPIRV_CROSS_SHARED=ON -DCMAKE_INSTALL_PREFIX=output -DCMAKE_BUILD_TYPE=Release -DSPIRV_CROSS_ENABLE_TESTS=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
- name: Build SPIRV-Cross
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake --build . --config Release --parallel 4
cmake --build . --config Release --target install
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-binaries
path: build/output
- name: Test SPIRV-Cross
shell: bash
working-directory: ${{github.workspace}}/build
run: ctest --verbose -C Release
build-mobile:
# iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
needs: build
name: "Build ${{ matrix.sdk }}"
strategy:
matrix:
include:
- platform: iOS
sdk: iphoneos
architectures: arm64
- platform: iOS
sdk: iphonesimulator
architectures: x86_64;arm64
- platform: tvOS
sdk: appletvos
architectures: arm64
- platform: tvOS
sdk: appletvsimulator
architectures: x86_64;arm64
env:
PARALLEL: -j 2
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Cache glslang / SPIRV-Tools
id: cache-externals
uses: actions/cache@v3
with:
path: external/*-build/output
key: ${{ matrix.platform }} externals ${{ hashFiles('checkout_glslang_spirv_tools.sh', 'build_glslang_spirv_tools.sh') }}
- name: Pull glslang / SPIRV-Tools
if: steps.cache-externals.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{github.workspace}}
run: ./checkout_glslang_spirv_tools.sh
- name: Build glslang / SPIRV-Tools
if: steps.cache-externals.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{github.workspace}}
run: ./build_glslang_spirv_tools.sh Release 4
- name: Configure SPIRV-Cross
shell: bash
run: |
mkdir build
cd build
cmake .. -DSPIRV_CROSS_WERROR=ON -DSPIRV_CROSS_MISC_WARNINGS=ON -DSPIRV_CROSS_SHARED=ON -DCMAKE_INSTALL_PREFIX=output -DCMAKE_BUILD_TYPE=Release -DSPIRV_CROSS_ENABLE_TESTS=ON -DCMAKE_SYSTEM_NAME=${{ matrix.platform }} -DCMAKE_OSX_ARCHITECTURES="${{ matrix.architectures }}" -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 -DCMAKE_OSX_SYSROOT=`xcodebuild -version -sdk ${{ matrix.sdk }} Path` -DBUILD_SHARED_LIBS=OFF
- name: Build SPIRV-Cross
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake --build . --config Release --parallel 4
cmake --build . --config Release --target install
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.sdk }}-binaries
path: build/output
reuse:
name: "REUSE license check"
runs-on: ubuntu-latest
container: khronosgroup/docker-images:asciidoctor-spec
steps:
- uses: actions/checkout@v3
# REUSE license checker
- name: license-check
run: |
reuse lint