-
Notifications
You must be signed in to change notification settings - Fork 1.4k
338 lines (328 loc) · 14.8 KB
/
buildusd.yml
File metadata and controls
338 lines (328 loc) · 14.8 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
name: BuildUSD
permissions:
contents: read
on:
push:
branches:
- dev
- release
pull_request:
branches:
- dev
paths:
- '**'
- '!.github/workflows/**'
jobs:
Validation:
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
validation-failed: ${{ steps.changed-workflows.outputs.any_changed }}
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #v4.3.1
with:
ref: ${{ github.ref }}
- name: Check workflows directory
id: changed-workflows
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c #v46
with:
files: |
.github/workflows/**
Linux:
needs:
- Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
runs-on: ubuntu-22.04
permissions:
contents: write # Grant write permissions in order to upload artifacts
env:
PYTHON_VERSION: "3.9.25"
timeout-minutes: 120
steps:
- name: Checkout Code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #v4.3.1
with:
ref: ${{ github.ref }}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
- name: Install Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
check-latest: false
- name: Install Build Dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y python3-setuptools libglew-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev
pip install --upgrade pip
pip install PySide2 PyOpenGL
- name: Build USD
run: |
# All tests are run for a push to fully validate the repository; tests requiring a GPU are executed in the
# GPUTests job. For other events like pull requests, we currently only run headless tests to minimize
# the use of the large GPU runner.
#
# Note in the latter case, we do not use the --tests argument to avoid building extra dependencies
# that aren't needed for headless tests.
if [ "$GITHUB_EVENT_NAME" == "push" ]; then
python3 build_scripts/build_usd.py --tests --no-materialx --build USDgen/build --src USDgen/src USDinst --build-args USD,"-DPXR_HEADLESS_TEST_MODE=OFF" -v
else
python3 build_scripts/build_usd.py --no-materialx --build USDgen/build --src USDgen/src USDinst --build-args USD,"-DPXR_HEADLESS_TEST_MODE=ON -DPXR_BUILD_TESTS=ON" -v
fi
- name: Save Build Artifacts to Cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: USDinst
key: ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
- name: Upload Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: usd-linux
path: ${{ github.workspace }}
include-hidden-files: true
- name: Run USD Headless Tests
working-directory: ./USDgen/build/OpenUSD
run: |
ctest --output-on-failure -j4 -C Release \
--exclude-regex "^(testUsdview|testUsdRecord|testUsdAppUtilsFrameRecorder|testUsdImaging|testHgiGL|testHdx|testHdSt|testExecGeomXformable_Perf_Large|testWorkThreadLimitsDefault)"
GPUTests:
needs:
- Linux
if: ${{ github.event_name == 'push' }}
runs-on: enterprise-linux-x64-t4gpu-4core-16vram-28ram-176ssd
permissions:
contents: write # Grant write permissions in order to upload artifacts
env:
# Ensure python is installed in the same location across different runners
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
PYTHON_VERSION: "3.9.25"
timeout-minutes: 30
steps:
- name: Install Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
check-latest: false
- name: Install Test Dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y python3-setuptools libglew-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev
sudo apt-get install -y cmake wget xvfb libfontconfig libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 libxcb-keysyms1 libxcb-shape0 libopenjp2-7 libjbig0 libxcb-xinerama0
# VirtualGL specifically asks for libegl1-mesa although it has largely been phased out in modern ubuntu versions
# Install an archive version of libegl1-mesa to satisfy the VirtualGL dependency
sudo wget http://archive.ubuntu.com/ubuntu/pool/universe/m/mesa/libegl1-mesa_23.0.4-0ubuntu1~22.04.1_amd64.deb
sudo apt install ./libegl1-mesa_23.0.4-0ubuntu1~22.04.1_amd64.deb
sudo apt-get install -y libxtst6 libxv1
# VirtualGL doesn't exist in the default repositories. Instead download the .deb package directly from sourceforge
sudo wget https://sourceforge.net/projects/virtualgl/files/3.1/virtualgl_3.1_amd64.deb
sudo dpkg -i virtualgl_3.1_amd64.deb
pip install --upgrade pip
pip install PySide2 PyOpenGL cmake
- name: Download USD Build
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 #v4.3.0
with:
name: usd-linux
- name: Restore Executable Permissions
run: |
# workaround for https://github.com/actions/upload-artifact/issues/38
find ${{ github.workspace }}/USDinst/tests -type f -print0 | xargs -0 chmod a+x
find ${{ github.workspace }}/USDinst/bin -type f -print0 | xargs -0 chmod a+x
find ${{ github.workspace }}/USDgen/build -type f -path "*/bin/*" -exec chmod a+x {} +
- name: Run USD GPU Tests
working-directory: ./USDgen/build/OpenUSD
run: |
# Known test failures in tests_to_ignore.txt tracked by internal ticket: USD-11921
sudo xvfb-run --server-args="-screen 0 2560x1600x24 +extension GLX +render" \
sudo vglrun +v -d egl \
ctest --output-on-failure -j4 -V -C Release \
--tests-regex "^(testUsdview|testUsdRecord|testUsdAppUtilsFrameRecorder|testUsdImaging|testHgiGL|testHdx|testHdSt)" \
--exclude-regex "^($(paste -sd "|" ${{ github.workspace }}/.github/workflows/tests_to_ignore.txt))$"
- name: Prepare Test Artifacts
if: always()
working-directory: ./USDgen/build/OpenUSD
run: |
if sudo [ -d "Testing/Failed-Diffs" ]; then
mkdir FailedTestOutput
sudo cp -r Testing/Failed-Diffs FailedTestOutput
sudo cp Testing/Temporary/LastTest.log FailedTestOutput
sudo chown -R runner:runner FailedTestOutput
fi
- name: Upload Test artifacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: FailedTestOutput
path: ./USDgen/build/OpenUSD/FailedTestOutput
if-no-files-found: ignore
macOS:
needs:
- Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
runs-on: macos-15
permissions:
contents: write # Grant write permissions in order to upload artifacts
env:
PYTHON_VERSION: "3.11"
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #v4.3.1
with:
ref: ${{ github.ref }}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
- name: Install Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
check-latest: false
- name: Install dependencies
run: |
export PATH=/Applications/CMake.app/Contents/bin:$PATH
sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
# Set SYSTEM_VERSION_COMPAT while installing Python packages to
# accommodate the macOS version numbering change from 10.x to 11
export SYSTEM_VERSION_COMPAT=1
pip install PySide6 PyOpenGL setuptools
export -n SYSTEM_VERSION_COMPAT
- name: Build USD
run: |
# Not using '--tests' to avoid building extra dependencies that are unneeded for headless tests
export PATH=/Applications/CMake.app/Contents/bin:$PATH
python3 build_scripts/build_usd.py --no-materialx --generator Xcode --build USDgen/build --src USDgen/src USDinst --build-args USD,"-DPXR_HEADLESS_TEST_MODE=ON -DPXR_BUILD_TESTS=ON" -v
- name: Save build artifacts to cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: |
USDinst
key: ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: usd-macOS
path: USDinst
- name: Test USD
working-directory: ./USDgen/build/OpenUSD
run: |
export PATH=/Applications/CMake.app/Contents/bin:$PATH
ctest --output-on-failure -j4 -C Release --exclude-regex "testExecGeomXformable_Perf_Large"
Windows:
needs:
- Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
runs-on: windows-2022
permissions:
contents: write # Grant write permissions in order to upload artifacts
env:
PYTHON_VERSION: "3.9"
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #v4.3.1
with:
ref: ${{ github.ref }}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
- name: Install Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
with:
python-version: ${{ env.PYTHON_VERSION }}
check-latest: false
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install PyOpenGL PySide2
- name: Build USD
run: |
# Not using '--tests' to avoid building extra dependencies that are unneeded for headless tests
python build_scripts/build_usd.py --no-materialx --generator "Visual Studio 17 2022" --build USDgen/build --src USDgen/src USDinst --build-args USD,"-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF -DPXR_HEADLESS_TEST_MODE=ON -DPXR_BUILD_TESTS=ON" -v
shell: cmd
- name: Save build artifacts to cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: |
USDinst
key: ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: usd-win64
path: USDinst
- name: Test USD
working-directory: ./USDgen/build/OpenUSD
run: |
call set PATH=${{ github.workspace }}\USDinst\bin;${{ github.workspace }}\USDinst\lib;${{ github.workspace }}\USDinst\share\usd\examples\plugin;${{ github.workspace }}\USDinst\plugin\usd;%PATH%
call set PYTHONPATH=${{ github.workspace }}\USDinst\lib\python;%PYTHONPATH%
# Internal ticket USD-8035
ctest --output-on-failure -j4 -C Release --exclude-regex "TfPathUtils|testExecGeomXformable_Perf_Large"
shell: cmd
Wasm:
needs:
- Validation
if: ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
strategy:
matrix:
target: [Wasm, Wasm64]
fail-fast: false
runs-on: ubuntu-22.04
permissions:
contents: write # Grant write permissions in order to upload artifacts
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 #v4.3.1
with:
ref: ${{ github.ref }}
- name: Install Emscripten SDK
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: |
USDgen/build
key: ${{ runner.os }}-BuildUSD-${{ matrix.target }}-${{ hashFiles('build_scripts/**/*') }}
- name: Build USD
run: |
source ${{ github.workspace }}/emsdk/emsdk_env.sh
python3 build_scripts/build_usd.py -v --build-target ${{ matrix.target }} USDinst \
--build USDgen/build --src USDgen/src \
--build-args USD,"-DPXR_HEADLESS_TEST_MODE=ON -DPXR_BUILD_TESTS=ON"
- name: Save build artifacts to cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 #v4.3.0
with:
path: |
USDgen/build
key: ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
- name: Upload artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: usd-${{ matrix.target }}
path: USDinst
- name: Test USD
working-directory: ./USDgen/build/OpenUSD
run: |
ctest --output-on-failure -j4 -C Release