forked from vsg-dev/vsgExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
237 lines (237 loc) · 9.25 KB
/
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
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
237
name: CI
on:
push:
pull_request:
env:
VulkanSDKVersion: 1.3.243.0
jobs:
linux-build:
runs-on: ubuntu-latest
env:
BuildDocEnabled: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
VULKAN_SDK: $GITHUB_WORKSPACE/../$VulkanSDKVersion/x86_64
steps:
- uses: actions/checkout@v2
with:
path: main
- name: Cache
id: cache
uses: actions/[email protected]
with:
path: ${{env.VULKAN_SDK}}
key: VulkanSdk${{env.VulkanSDKVersion}}ExtractedLinux
- name: Download & Extract Vulkan SDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
wget --no-cookies -O ../vulkansdk-linux-x86_64-${{env.VulkanSDKVersion}}.tar.gz wget https://sdk.lunarg.com/sdk/download/${{env.VulkanSDKVersion}}/linux/vulkansdk-linux-x86_64-${{env.VulkanSDKVersion}}.tar.gz?u=
tar -zxf ../vulkansdk-linux-x86_64-${{env.VulkanSDKVersion}}.tar.gz -C ../
- name: Extract branch name
shell: bash
run: echo ::set-output name=BRANCH_NAME::${GITHUB_REF#refs/*/}
id: extract_branch
- name: VSG Checkout (If Remote Branch Exists)
if: github.event_name == 'push'
id: has-remote-branch
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
ref: ${{steps.extract_branch.outputs.branch}}
continue-on-error: true
- name: VSG Checkout (Master)
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
if: ${{ (steps.has-remote-branch.outcome == 'failure') || (github.event_name == 'pull_request') }}
- name: VSG Build and Install
run: |
cd vsg
cmake -D Vulkan_INCLUDE_DIR="${{env.VULKAN_SDK}}/include" \
-D Vulkan_LIBRARY="${{env.VULKAN_SDK}}/lib/libvulkan.so" .
make -j 2
sudo make install
- name: vsgExamples Build and Install
run: |
cd main
cmake -D Vulkan_INCLUDE_DIR="${{env.VULKAN_SDK}}/include" \
-D Vulkan_LIBRARY="${{env.VULKAN_SDK}}/lib/libvulkan.so" .
make -j 2
sudo make install
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
path: main
- name: Set env
id: env
run: echo "::set-output name=VULKAN_SDK::C:\VulkanSDK\${{env.VulkanSDKVersion}}"
- name: Cache
id: cache
uses: actions/[email protected]
with:
path: ${{steps.env.outputs.VULKAN_SDK}}
key: VulkanSdk${{env.VulkanSDKVersion}}WindowsExtracted2
- name: Download & Install Vulkan SDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/${{env.VulkanSDKVersion}}/windows/VulkanSDK-${{env.VulkanSDKVersion}}-Installer.exe?u= -OutFile ../vulkan-sdk-${{env.VulkanSDKVersion}}.exe
$installer = Start-Process -FilePath ../vulkan-sdk-${{env.VulkanSDKVersion}}.exe -Wait -PassThru -ArgumentList @("/S");
$installer.WaitForExit();
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: VSG Checkout (If Remote Branch Exists)
if: github.event_name == 'push'
id: has-remote-branch
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
ref: ${{steps.extract_branch.outputs.branch}}
continue-on-error: true
- name: VSG Checkout (Master)
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
if: ${{ (steps.has-remote-branch.outcome == 'failure') || (github.event_name == 'pull_request') }}
- name: VSG CMake Configure MSBuild Build and Install
run: |
cd vsg
cmake . -A x64
MSBuild.exe ALL_BUILD.vcxproj -p:Configuration=Release
MSBuild.exe INSTALL.vcxproj -p:Configuration=Release
env:
VULKAN_SDK: ${{steps.env.outputs.VULKAN_SDK}}
- name: vsgExamples CMake Configuration MSBuild Build and Install
run: |
cd main
cmake . -A x64 -Dvsg_DIR="C:\Program Files\vsg\lib\cmake\vsg" -Dvsg_glslang_DIR="C:\Program Files\vsg\lib\cmake\vsg_glslang"
MSBuild.exe ALL_BUILD.vcxproj -p:Configuration=Release
MSBuild.exe INSTALL.vcxproj -p:Configuration=Release
env:
VULKAN_SDK: ${{steps.env.outputs.VULKAN_SDK}}
windows-dll-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
path: main
- name: Set env
id: env
run: echo "::set-output name=VULKAN_SDK::C:\VulkanSDK\${{env.VulkanSDKVersion}}"
- name: Cache
id: cache
uses: actions/[email protected]
with:
path: ${{steps.env.outputs.VULKAN_SDK}}
key: VulkanSdk${{env.VulkanSDKVersion}}WindowsExtracted2
- name: Download & Install Vulkan SDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/${{env.VulkanSDKVersion}}/windows/VulkanSDK-${{env.VulkanSDKVersion}}-Installer.exe?u= -OutFile ../vulkan-sdk-${{env.VulkanSDKVersion}}.exe
$installer = Start-Process -FilePath ../vulkan-sdk-${{env.VulkanSDKVersion}}.exe -Wait -PassThru -ArgumentList @("/S");
$installer.WaitForExit();
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: VSG Checkout (If Remote Branch Exists)
if: github.event_name == 'push'
id: has-remote-branch
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
ref: ${{steps.extract_branch.outputs.branch}}
continue-on-error: true
- name: VSG Checkout (Master)
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
if: ${{ (steps.has-remote-branch.outcome == 'failure') || (github.event_name == 'pull_request') }}
- name: VSG CMake Configure MSBuild Build and Install
run: |
cd vsg
cmake . -A x64 -DBUILD_SHARED_LIBS=ON
MSBuild.exe ALL_BUILD.vcxproj -p:Configuration=Release
MSBuild.exe INSTALL.vcxproj -p:Configuration=Release
env:
VULKAN_SDK: ${{steps.env.outputs.VULKAN_SDK}}
- name: vsgExamples CMake Configuration MSBuild Build and Install
run: |
cd main
cmake . -A x64 -Dvsg_DIR="C:\Program Files\vsg\lib\cmake\vsg" -Dvsg_glslang_DIR="C:\Program Files\vsg\lib\cmake\vsg_glslang"
MSBuild.exe ALL_BUILD.vcxproj -p:Configuration=Release
MSBuild.exe INSTALL.vcxproj -p:Configuration=Release
env:
VULKAN_SDK: ${{steps.env.outputs.VULKAN_SDK}}
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
path: main
- name: Set env
id: env
run: |
VULKAN_SDK=$GITHUB_WORKSPACE/../vulkansdk-macos-${{env.VulkanSDKVersion}}/macOS
echo ::set-output name=VULKAN_SDK::$VULKAN_SDK
echo "VK_LAYER_PATH=$VULKAN_SDK/etc/vulkan/explicit_layer.d" >> $GITHUB_ENV
echo "VK_ICD_FILENAMES=$VULKAN_SDK/etc/vulkan/icd.d/MoltenVK_icd.json" >> $GITHUB_ENV
- name: Cache
id: cache
uses: actions/[email protected]
with:
path: ${{steps.env.outputs.VULKAN_SDK}}
key: VulkanSdk${{env.VulkanSDKVersion}}ExtractedMacos
- name: Download & Extract Vulkan SDK
if: steps.cache.outputs.cache-hit != 'true'
run: |
wget --no-cookies -O ../vulkansdk-macos-${{env.VulkanSDKVersion}}.dmg https://sdk.lunarg.com/sdk/download/${{env.VulkanSDKVersion}}/mac/vulkansdk-macos-${{env.VulkanSDKVersion}}.dmg?u=
hdiutil attach ../vulkansdk-macos-${{env.VulkanSDKVersion}}.dmg
cp -r /Volumes/vulkansdk-macos-${{env.VulkanSDKVersion}} $GITHUB_WORKSPACE/..
hdiutil detach /Volumes/vulkansdk-macos-${{env.VulkanSDKVersion}}
- name: VSG Checkout (If Remote Branch Exists)
if: github.event_name == 'push'
id: has-remote-branch
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
ref: $${{ github.ref_name }}
continue-on-error: true
- name: VSG Checkout (Master)
uses: actions/checkout@v2
with:
repository: vsg-dev/VulkanSceneGraph
path: vsg
if: ${{ (steps.has-remote-branch.outcome == 'failure') || (github.event_name == 'pull_request') }}
- name: VSG CMake Configure Build and Install
run: |
cd vsg
export DYLD_LIBRARY_PATH="$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH"
export PATH="$VULKAN_SDK:$VULKAN_SDK/bin:$PATH"
cmake -D CMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/../vsg-$GITHUB_SHA" .
make -j 2
make install
env:
VULKAN_SDK: ${{steps.env.outputs.VULKAN_SDK}}
- name: vsgExamples CMake Configure Build and Install
run: |
cd main
export DYLD_LIBRARY_PATH="$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH"
export PATH="$VULKAN_SDK:$VULKAN_SDK/bin:$GITHUB_WORKSPACE/../vsg-$GITHUB_SHA:$PATH"
cmake .
make -j 2
make install
env:
VULKAN_SDK: ${{steps.env.outputs.VULKAN_SDK}}