11name : BuildUSD
22
3+ permissions :
4+ contents : read
5+
36on :
47 push :
58 branches :
2023 validation-failed : ${{ steps.changed-workflows.outputs.any_changed }}
2124 steps :
2225 - name : Checkout code
23- uses : actions/checkout@v4
26+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2427 with :
2528 ref : ${{ github.ref }}
2629 - name : Check workflows directory
@@ -35,23 +38,25 @@ jobs:
3538 - Validation
3639 if : ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
3740 runs-on : ubuntu-22.04
41+ permissions :
42+ contents : write # Grant write permissions in order to upload artifacts
3843 env :
3944 PYTHON_VERSION : " 3.9.25"
4045 timeout-minutes : 120
4146 steps :
4247 - name : Checkout Code
43- uses : actions/checkout@v4
48+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4449 with :
4550 ref : ${{ github.ref }}
4651 - name : Restore cached artifacts
4752 id : cache-usd-build-dependency
48- uses : actions/cache/restore@v4
53+ uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
4954 with :
5055 path : |
5156 USDinst
5257 key : ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
5358 - name : Install Python
54- uses : actions/setup-python@v5
59+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
5560 with :
5661 python-version : ${{ env.PYTHON_VERSION }}
5762 check-latest : false
@@ -76,12 +81,12 @@ jobs:
7681 fi
7782 - name : Save Build Artifacts to Cache
7883 if : steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
79- uses : actions/cache/save@v4
84+ uses : actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
8085 with :
8186 path : USDinst
8287 key : ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
8388 - name : Upload Artifact
84- uses : actions/upload-artifact@v4
89+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
8590 with :
8691 name : usd-linux
8792 path : ${{ github.workspace }}
@@ -97,14 +102,16 @@ jobs:
97102 - Linux
98103 if : ${{ github.event_name == 'push' }}
99104 runs-on : enterprise-linux-x64-t4gpu-4core-16vram-28ram-176ssd
105+ permissions :
106+ contents : write # Grant write permissions in order to upload artifacts
100107 env :
101108 # Ensure python is installed in the same location across different runners
102109 AGENT_TOOLSDIRECTORY : /opt/hostedtoolcache
103110 PYTHON_VERSION : " 3.9.25"
104111 timeout-minutes : 30
105112 steps :
106113 - name : Install Python
107- uses : actions/setup-python@v5
114+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
108115 with :
109116 python-version : ${{ env.PYTHON_VERSION }}
110117 check-latest : false
@@ -126,7 +133,7 @@ jobs:
126133 pip install --upgrade pip
127134 pip install PySide2 PyOpenGL cmake
128135 - name : Download USD Build
129- uses : actions/download-artifact@v4
136+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
130137 with :
131138 name : usd-linux
132139 - name : Restore Executable Permissions
@@ -156,7 +163,7 @@ jobs:
156163 fi
157164 - name : Upload Test artifacts
158165 if : always()
159- uses : actions/upload-artifact@v4
166+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
160167 with :
161168 name : FailedTestOutput
162169 path : ./USDgen/build/OpenUSD/FailedTestOutput
@@ -167,23 +174,25 @@ jobs:
167174 - Validation
168175 if : ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
169176 runs-on : macos-15
177+ permissions :
178+ contents : write # Grant write permissions in order to upload artifacts
170179 env :
171180 PYTHON_VERSION : " 3.11"
172181 timeout-minutes : 120
173182 steps :
174183 - name : Checkout code
175- uses : actions/checkout@v4
184+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
176185 with :
177186 ref : ${{ github.ref }}
178187 - name : Restore cached artifacts
179188 id : cache-usd-build-dependency
180- uses : actions/cache/restore@v4
189+ uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
181190 with :
182191 path : |
183192 USDinst
184193 key : ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
185194 - name : Install Python
186- uses : actions/setup-python@v5
195+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
187196 with :
188197 python-version : ${{ env.PYTHON_VERSION }}
189198 check-latest : false
@@ -203,13 +212,13 @@ jobs:
203212 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
204213 - name : Save build artifacts to cache
205214 if : steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
206- uses : actions/cache/save@v4
215+ uses : actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
207216 with :
208217 path : |
209218 USDinst
210219 key : ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
211220 - name : Upload artifacts
212- uses : actions/upload-artifact@v4
221+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
213222 with :
214223 name : usd-macOS
215224 path : USDinst
@@ -224,23 +233,25 @@ jobs:
224233 - Validation
225234 if : ${{ (github.event_name == 'pull_request' && needs.Validation.outputs.validation-failed != 'true') || github.event_name == 'push' }}
226235 runs-on : windows-2022
236+ permissions :
237+ contents : write # Grant write permissions in order to upload artifacts
227238 env :
228239 PYTHON_VERSION : " 3.9"
229240 timeout-minutes : 120
230241 steps :
231242 - name : Checkout code
232- uses : actions/checkout@v4
243+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
233244 with :
234245 ref : ${{ github.ref }}
235246 - name : Restore cached artifacts
236247 id : cache-usd-build-dependency
237- uses : actions/cache/restore@v4
248+ uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
238249 with :
239250 path : |
240251 USDinst
241252 key : ${{ runner.os }}-BuildUSD-py${{ env.PYTHON_VERSION }}-${{ hashFiles('build_scripts/**/*') }}
242253 - name : Install Python
243- uses : actions/setup-python@v5
254+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
244255 with :
245256 python-version : ${{ env.PYTHON_VERSION }}
246257 check-latest : false
@@ -255,13 +266,13 @@ jobs:
255266 shell : cmd
256267 - name : Save build artifacts to cache
257268 if : steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
258- uses : actions/cache/save@v4
269+ uses : actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
259270 with :
260271 path : |
261272 USDinst
262273 key : ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
263274 - name : Upload artifacts
264- uses : actions/upload-artifact@v4
275+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
265276 with :
266277 name : usd-win64
267278 path : USDinst
@@ -283,9 +294,11 @@ jobs:
283294 target : [Wasm, Wasm64]
284295 fail-fast : false
285296 runs-on : ubuntu-22.04
297+ permissions :
298+ contents : write # Grant write permissions in order to upload artifacts
286299 steps :
287300 - name : Checkout code
288- uses : actions/checkout@v4
301+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
289302 with :
290303 ref : ${{ github.ref }}
291304 - name : Install Emscripten SDK
@@ -296,7 +309,7 @@ jobs:
296309 ./emsdk activate latest
297310 - name : Restore cached artifacts
298311 id : cache-usd-build-dependency
299- uses : actions/cache/restore@v4
312+ uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
300313 with :
301314 path : |
302315 USDgen/build
@@ -309,13 +322,13 @@ jobs:
309322 --build-args USD,"-DPXR_HEADLESS_TEST_MODE=ON -DPXR_BUILD_TESTS=ON"
310323 - name : Save build artifacts to cache
311324 if : steps.cache-usd-build-dependency.outputs.cache-hit != 'true'
312- uses : actions/cache/save@v4
325+ uses : actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
313326 with :
314327 path : |
315328 USDgen/build
316329 key : ${{ steps.cache-usd-build-dependency.outputs.cache-primary-key }}
317330 - name : Upload artifacts
318- uses : actions/upload-artifact@v4
331+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
319332 with :
320333 name : usd-${{ matrix.target }}
321334 path : USDinst
0 commit comments