forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 0
192 lines (187 loc) · 7.17 KB
/
buildusd.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
name: BuildUSD
on:
push:
branches:
- dev
- release
issue_comment:
types: [created]
env:
PYTHON_VERSION: "3.9"
PYTHON_VERSION_MAC: "3.11"
jobs:
GetUser:
runs-on: ubuntu-20.04
timeout-minutes: 5
outputs:
require-result: ${{ steps.check.outputs.require-result }}
steps:
- uses: actions-cool/check-user-permission@v2
id: check
with:
require: 'write'
username: ${{ github.event.comment.user.login }}
GetGitRef:
runs-on: ubuntu-20.04
timeout-minutes: 5
outputs:
ref: ${{ steps.setter.outputs.ref }}
steps:
- name: Get push ref
if: ${{ github.event_name == 'push' }}
run: |
echo "REF=${{ github.ref }}" >> $GITHUB_ENV
- name: Get PR ref
if: ${{ github.event.issue.pull_request }}
run: |
echo "REF=refs/pull/${{ github.event.issue.number }}/merge" >> $GITHUB_ENV
- name: Print ENV_VAR
run: |
echo "The value of REF is $REF"
- name: Set ENV_VAR
id: setter
run: |
echo "ref=$REF" >> "$GITHUB_OUTPUT"
Linux:
needs: [GetUser, GetGitRef]
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }}
runs-on: ubuntu-20.04
timeout-minutes: 120
steps:
- run: echo ${{ needs.GetUser.outputs.require-result }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{needs.GetGitRef.outputs.ref}}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@v4
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
check-latest: false
- name: Install 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: |
python3 build_scripts/build_usd.py --no-materialx --build USDgen/build --src USDgen/src USDinst -v
- name: Save build artifacts to cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: usd-linux
path: USDinst
macOS:
needs: [GetUser, GetGitRef]
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }}
runs-on: macos-13
timeout-minutes: 120
steps:
- run: echo ${{ needs.GetUser.outputs.require-result }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{needs.GetGitRef.outputs.ref}}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@v4
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION_MAC }}-${{ hashFiles('build_scripts/**/*') }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_MAC }}
check-latest: false
- name: Install dependencies
run: |
export PATH=/Applications/CMake.app/Contents/bin:$PATH
sudo xcode-select -s /Applications/Xcode_14.1.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: |
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 -v
- name: Save build artifacts to cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION_MAC }}-${{ hashFiles('build_scripts/**/*') }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: usd-macOS
path: USDinst
Windows:
needs: [GetUser, GetGitRef]
if: ${{ (github.event.issue.pull_request && contains(github.event.comment.body, '/AzurePipelines run') && needs.GetUser.outputs.require-result == 'true' ) || github.event_name == 'push' }}
runs-on: windows-2019
timeout-minutes: 120
steps:
- run: echo ${{ needs.GetUser.outputs.require-result }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{needs.GetGitRef.outputs.ref}}
- name: Restore cached artifacts
id: cache-usd-build-dependency
uses: actions/cache/restore@v4
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
- name: Install Python
uses: actions/setup-python@v5
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: |
REM Unset BOOST_ROOT on Windows. The VS2017-Win2016 image
REM sets this env var to a pre-installed boost which causes
REM the USD build to favor this over the boost built by
REM build_usd.py. This causes the build to fail, because
REM the pre-installed boost does not include boost_python27
call set BOOST_ROOT=
python build_scripts/build_usd.py --no-materialx --generator "Visual Studio 16 2019" --build USDgen/build --src USDgen/src USDinst --build-args USD,"-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF" -v
shell: cmd
- name: Save build artifacts to cache
if: steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
USDinst
key: ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
- name: Upload artifacts
# use v3 because actions/upload-artifact@v4 fails
# see https://github.com/actions/upload-artifact/issues/485
uses: actions/upload-artifact@v3
with:
name: usd-win64
path: USDinst