-
Notifications
You must be signed in to change notification settings - Fork 6
218 lines (184 loc) · 6.98 KB
/
run-tests.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
name: Run Tests
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
inputs:
enable-graphical-tests-mtlx:
description: Enable MaterialX graphical tests
type: boolean
default: false
enable-graphical-tests-preview:
description: Enable preview graphical tests
type: boolean
default: false
enable-usdchecker:
description: Run usdchecker on converted USD files
type: boolean
default: true
tests-branch:
description: Tests branch name
type: string
default: 'main'
test-filter:
description: Filter (regular expression)
type: string
defaults:
run:
shell: bash
jobs:
build-debug:
name: Build guc for USD v24.03 (Debug)
uses: ./.github/workflows/build-usd24.03.yml
with:
build-config: Debug
extra-cmake-flags: -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
build-release:
name: Build guc for USD v24.03 (Release)
uses: ./.github/workflows/build-usd24.03.yml
with:
build-config: Release
extra-cmake-flags: -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
smoke-test:
name: Smoke Test ${{ matrix.os-family }} (Release)
runs-on: ${{ matrix.image }}
needs: build-release
strategy:
fail-fast: false
matrix:
include:
- os-family: Linux
image: ubuntu-20.04
usd-download-url: "https://github.com/pablode/USD/releases/download/v24.03-ci-release/USD24.03_Linux_x64_Python3.9.tar.gz"
artifact-name: guc_USD24.03_Linux_x64_Python3.9.tar.gz
executable-name: guc
- os-family: Windows
image: windows-2019
usd-download-url: "https://github.com/pablode/USD/releases/download/v24.03-ci-release/USD24.03_Windows_x64_Python3.9.tar.gz"
artifact-name: guc_USD24.03_Windows_x64_Python3.9.tar.gz
executable-name: guc.exe
steps:
- name: Fetch USD binaries
run: curl ${{ matrix.usd-download-url }} -L -v -o USD.tar.gz
- name: Install USD binaries
run: mkdir -p USD_INSTALL && tar -xvf USD.tar.gz -C $PWD/USD_INSTALL
- name: Download guc artifacts
id: download-guc
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-release.outputs.archive-name }}
- name: Install guc
run: mkdir -p GUC_INSTALL && tar -xvf ${{ matrix.artifact-name}} -C $PWD/GUC_INSTALL
- name: Set up environment variables (Linux)
if: matrix.os-family == 'Linux'
run: echo "LD_LIBRARY_PATH=$PWD/USD_INSTALL/lib" >> $GITHUB_ENV
- name: Set up environment variables (Windows)
if: matrix.os-family == 'Windows'
run: |
# We need to use real Windows paths, instead of MSYS2's auto-converted Unix paths
echo "$(pwd -W)/USD_INSTALL/lib" >> $GITHUB_PATH
echo "$(pwd -W)/USD_INSTALL/bin" >> $GITHUB_PATH
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Fetch example glTF file
run: mkdir test && curl "https://github.com/KhronosGroup/glTF-Sample-Models/raw/db9ff67c1116cfe28eb36320916bccd8c4127cc1/2.0/ToyCar/glTF-Binary/ToyCar.glb" -L -v -o test/asset.glb
- name: Run test
working-directory: test
run: ../GUC_INSTALL/bin/${{ matrix.executable-name }} asset.glb asset.usda --emit-mtlx
- name: Print output info
working-directory: test
run: |
ls -la .
cat asset.mtlx
cat asset.usda
conversion-tests:
name: Conversion Tests (Debug)
runs-on: ubuntu-20.04
needs: build-debug
env:
USD_DOWNLOAD_URL: "https://github.com/pablode/USD/releases/download/v24.03-ci-release/USD24.03_Linux_x64_Python3.9.tar.gz"
GUC_ARTIFACT_NAME: guc_USD24.03_Linux_x64_Python3.9.tar.gz
USD_INSTALL_PATH: /home/runner/work/USD/USD/INSTALL
steps:
- name: Fetch USD binaries
run: curl ${{ env.USD_DOWNLOAD_URL }} -L -v -o USD.tar.gz
- name: Install USD binaries
run: mkdir -p ${{ env.USD_INSTALL_PATH }} && tar -xvf USD.tar.gz -C ${{ env.USD_INSTALL_PATH }}
- name: Download guc artifacts
id: download-guc
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-debug.outputs.archive-name }}
# Install guc to the USD installation so that we can use the usdGlTF Sdf plugin
- name: Install guc
run: tar -xvf ${{ env.GUC_ARTIFACT_NAME }} -C ${{ env.USD_INSTALL_PATH }}
- name: Install packages
run: |
# Use latest stable mesa because Storm requires OpenGL 4.6
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade
sudo apt-get install mesa-utils xvfb qt5-default
- name: Set up environment variables
run: |
# Test options
if [[ -z "${{ inputs.enable-graphical-tests-mtlx }}" ]] || [[ "${{ inputs.enable-graphical-tests-mtlx }}" = "false" ]]; then
echo "GT_DISABLE_GRAPHICAL_MTLX=1" >> $GITHUB_ENV
fi
if [[ -z "${{ inputs.enable-graphical-tests-preview }}" ]] || [[ "${{ inputs.enable-graphical-tests-preview }}" = "false" ]]; then
echo "GT_DISABLE_GRAPHICAL_PREVIEW=1" >> $GITHUB_ENV
fi
if [[ -z "${{ inputs.enable-usdchecker }}" ]] || [[ "${{ inputs.enable-usdchecker }}" = "false" ]]; then
echo "GT_DISABLE_USDCHECKER=1" >> $GITHUB_ENV
fi
# Executables and libraries
echo "${{ env.USD_INSTALL_PATH }}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${{ env.USD_INSTALL_PATH }}/lib" >> $GITHUB_ENV
echo "PYTHONPATH=${{ env.USD_INSTALL_PATH }}/lib/python" >> $GITHUB_ENV
# Software rendering
echo "DISPLAY=:1" >> $GITHUB_ENV
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
echo "GALLIUM_DRIVER=llvmpipe" >> $GITHUB_ENV
echo "MESA_NO_ERROR=1" >> $GITHUB_ENV
# guc debug output
echo "TF_DEBUG=GUC" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
# usdrecord needs python (may change soon!)
- name: Install Python packages
run: pip3 install --user PySide2 PyOpenGL
- name: Start virtual framebuffer
run: |
Xvfb :1 -screen 0 1280x960x24 &
- name: Test glxinfo
run: glxinfo
- name: Print guc help
run: guc || [ $? -eq 1 ]
- name: Check out tests repository
uses: actions/checkout@v3
with:
repository: pablode/guc-tests
submodules: recursive
ref: ${{ inputs.tests-branch }}
- name: Run tests
run: bash ./run_tests.sh "${{ inputs.test-filter }}"
- name: Create test output archive
if: success() || failure()
working-directory: tests/output
run: tar -zcvf ../../test-output.tar.gz *
- name: Upload archive
if: success() || failure()
uses: actions/upload-artifact@v3
with:
path: test-output.tar.gz
if-no-files-found: error
name: test-output-${{ github.sha }}
retention-days: 7