Skip to content

Commit 6cce750

Browse files
authored
Upgrade ci linux job to v2 (#7819)
* Upgrade ci linux job * Add read/write permissions * Remove duplicate permissions
1 parent f9aa6c1 commit 6cce750

File tree

9 files changed

+126
-32
lines changed

9 files changed

+126
-32
lines changed

.github/workflows/_android.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ on:
77
jobs:
88
build-llm-demo:
99
name: build-llm-demo
10-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
10+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
11+
permissions:
12+
id-token: write
13+
contents: read
1114
with:
1215
runner: linux.2xlarge
1316
docker-image: executorch-ubuntu-22.04-clang12-android

.github/workflows/_unittest.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ on:
1414

1515
jobs:
1616
linux:
17-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
17+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
18+
permissions:
19+
id-token: write
20+
contents: read
1821
with:
1922
runner: linux.2xlarge
2023
docker-image: ${{ inputs.docker-image }}

.github/workflows/android-perf.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ jobs:
155155

156156
export-models:
157157
name: export-models
158-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
158+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
159+
permissions:
160+
id-token: write
161+
contents: read
159162
needs: set-parameters
160163
secrets: inherit
161164
strategy:
@@ -332,7 +335,10 @@ jobs:
332335
333336
build-benchmark-app:
334337
name: build-benchmark-app
335-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
338+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
339+
permissions:
340+
id-token: write
341+
contents: read
336342
needs: set-parameters
337343
with:
338344
runner: linux.2xlarge

.github/workflows/android-release-artifacts.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ jobs:
3131
build-aar:
3232
name: build-aar
3333
needs: check-if-aar-exists
34-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
34+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
35+
permissions:
36+
id-token: write
37+
contents: read
3538
with:
3639
runner: linux.2xlarge
3740
docker-image: executorch-ubuntu-22.04-clang12-android

.github/workflows/doc-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ on:
1515

1616
jobs:
1717
build:
18-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
18+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
19+
permissions:
20+
id-token: write
21+
contents: read
1922
strategy:
2023
matrix:
2124
include:
@@ -82,7 +85,8 @@ jobs:
8285
if: github.repository == 'pytorch/executorch' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
8386
permissions:
8487
contents: write
85-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
88+
contents: read
89+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
8690
with:
8791
repository: pytorch/executorch
8892
download-artifact: docs

.github/workflows/lint.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ concurrency:
1616

1717
jobs:
1818
lintrunner:
19-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
19+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
20+
permissions:
21+
id-token: write
22+
contents: read
2023
with:
2124
runner: linux.2xlarge
2225
docker-image: executorch-ubuntu-22.04-linter
@@ -62,7 +65,10 @@ jobs:
6265
exit $RC
6366
6467
android-java-format:
65-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
68+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
69+
permissions:
70+
id-token: write
71+
contents: read
6672
with:
6773
runner: linux.2xlarge
6874
docker-image: executorch-ubuntu-22.04-linter

.github/workflows/periodic.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ jobs:
3939
4040
test-models-linux:
4141
name: test-models-linux
42-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
42+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
43+
permissions:
44+
id-token: write
45+
contents: read
4346
needs: gather-models
4447
strategy:
4548
matrix: ${{ fromJSON(needs.gather-models.outputs.models) }}

.github/workflows/pull.yml

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ jobs:
3333
3434
test-setup-linux-gcc:
3535
name: test-setup-linux-gcc
36-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
36+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
37+
permissions:
38+
id-token: write
39+
contents: read
3740
strategy:
3841
fail-fast: false
3942
with:
@@ -55,7 +58,10 @@ jobs:
5558
5659
test-models-linux:
5760
name: test-models-linux
58-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
61+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
62+
permissions:
63+
id-token: write
64+
contents: read
5965
needs: gather-models
6066
strategy:
6167
matrix: ${{ fromJSON(needs.gather-models.outputs.models) }}
@@ -82,7 +88,10 @@ jobs:
8288
8389
test-llama-runner-linux:
8490
name: test-llama-runner-linux
85-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
91+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
92+
permissions:
93+
id-token: write
94+
contents: read
8695
strategy:
8796
matrix:
8897
dtype: [fp32]
@@ -121,7 +130,10 @@ jobs:
121130
122131
test-llama-runner-linux-android:
123132
name: test-llama-runner-linux-android
124-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
133+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
134+
permissions:
135+
id-token: write
136+
contents: read
125137
strategy:
126138
fail-fast: false
127139
with:
@@ -141,7 +153,10 @@ jobs:
141153
142154
test-custom-ops-linux:
143155
name: test-custom-ops-linux
144-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
156+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
157+
permissions:
158+
id-token: write
159+
contents: read
145160
strategy:
146161
fail-fast: false
147162
with:
@@ -162,7 +177,10 @@ jobs:
162177
163178
test-selective-build-linux:
164179
name: test-selective-build-linux
165-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
180+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
181+
permissions:
182+
id-token: write
183+
contents: read
166184
strategy:
167185
fail-fast: false
168186
with:
@@ -183,7 +201,10 @@ jobs:
183201
184202
test-llava-runner-linux:
185203
name: test-llava-runner-linux
186-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
204+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
205+
permissions:
206+
id-token: write
207+
contents: read
187208
strategy:
188209
fail-fast: false
189210
with:
@@ -214,7 +235,10 @@ jobs:
214235
215236
test-quantized-aot-lib-linux:
216237
name: test-quantized-aot-lib-linux
217-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
238+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
239+
permissions:
240+
id-token: write
241+
contents: read
218242
strategy:
219243
fail-fast: false
220244
with:
@@ -234,7 +258,10 @@ jobs:
234258
235259
test-pybind-build-linux:
236260
name: test-pybind-build-linux
237-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
261+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
262+
permissions:
263+
id-token: write
264+
contents: read
238265
strategy:
239266
fail-fast: false
240267
with:
@@ -260,7 +287,10 @@ jobs:
260287
261288
test-binary-size-linux-gcc:
262289
name: test-binary-size-linux-gcc
263-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
290+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
291+
permissions:
292+
id-token: write
293+
contents: read
264294
strategy:
265295
fail-fast: false
266296
with:
@@ -292,7 +322,10 @@ jobs:
292322
293323
test-binary-size-linux:
294324
name: test-binary-size-linux
295-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
325+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
326+
permissions:
327+
id-token: write
328+
contents: read
296329
strategy:
297330
fail-fast: false
298331
with:
@@ -365,7 +398,10 @@ jobs:
365398
366399
test-llama-runner-qnn-linux:
367400
name: test-llama-runner-qnn-linux
368-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
401+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
402+
permissions:
403+
id-token: write
404+
contents: read
369405
strategy:
370406
matrix:
371407
dtype: [fp32]
@@ -400,7 +436,10 @@ jobs:
400436
401437
test-qnn-models-linux:
402438
name: test-qnn-models-linux
403-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
439+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
440+
permissions:
441+
id-token: write
442+
contents: read
404443
strategy:
405444
fail-fast: false
406445
with:
@@ -419,7 +458,10 @@ jobs:
419458
420459
test-phi-3-mini-runner-linux:
421460
name: test-phi-3-mini-runner-linux
422-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
461+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
462+
permissions:
463+
id-token: write
464+
contents: read
423465
strategy:
424466
fail-fast: false
425467
with:
@@ -446,7 +488,10 @@ jobs:
446488
447489
test-eval_llama-wikitext-linux:
448490
name: test-eval_llama-wikitext-linux
449-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
491+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
492+
permissions:
493+
id-token: write
494+
contents: read
450495
strategy:
451496
fail-fast: false
452497
with:
@@ -473,7 +518,10 @@ jobs:
473518
474519
test-eval_llama-mmlu-linux:
475520
name: test-eval_llama-mmlu-linux
476-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
521+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
522+
permissions:
523+
id-token: write
524+
contents: read
477525
strategy:
478526
fail-fast: false
479527
with:
@@ -500,7 +548,10 @@ jobs:
500548
501549
test-llama_runner_eager-linux:
502550
name: test-llama_runner_eager-linux
503-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
551+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
552+
permissions:
553+
id-token: write
554+
contents: read
504555
strategy:
505556
fail-fast: false
506557
with:
@@ -527,7 +578,10 @@ jobs:
527578
528579
test-mediatek-models-linux:
529580
name: test-mediatek-models-linux
530-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
581+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
582+
permissions:
583+
id-token: write
584+
contents: read
531585
strategy:
532586
fail-fast: false
533587
with:

.github/workflows/trunk.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ jobs:
107107
108108
test-demo-backend-delegation:
109109
name: test-demo-backend-delegation
110-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
110+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
111+
permissions:
112+
id-token: write
113+
contents: read
111114
strategy:
112115
matrix:
113116
include:
@@ -301,7 +304,10 @@ jobs:
301304

302305
test-qnn-model:
303306
name: test-qnn-model
304-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
307+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
308+
permissions:
309+
id-token: write
310+
contents: read
305311
strategy:
306312
matrix:
307313
dtype: [fp32]
@@ -361,7 +367,10 @@ jobs:
361367
# NB: Don't run this on fork PRs because they won't have access to the secret and would fail anyway
362368
if: ${{ !github.event.pull_request.head.repo.fork }}
363369
name: test-huggingface-transformers
364-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
370+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
371+
permissions:
372+
id-token: write
373+
contents: read
365374
secrets: inherit
366375
strategy:
367376
matrix:
@@ -445,7 +454,10 @@ jobs:
445454
446455
test-llama-runner-qnn-linux:
447456
name: test-llama-runner-qnn-linux
448-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
457+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
458+
permissions:
459+
id-token: write
460+
contents: read
449461
strategy:
450462
matrix:
451463
dtype: [fp32]

0 commit comments

Comments
 (0)