Skip to content

Commit 4621ad2

Browse files
committed
Add checkout mode to linux job v2
1 parent 83fa301 commit 4621ad2

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/linux_job_v2.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ on:
4040
description: 'Number of commits to fetch, defaults to 1 similar to actions/checkout'
4141
default: 1
4242
type: number
43+
checkout-mode:
44+
description: 'Mode of checkout; one of "normal", "blobless", "treeless".'
45+
default: "normal"
46+
type: string
4347
submodules:
4448
description:
4549
Same as actions/checkout, set to `true` to checkout submodules or `recursive` to
@@ -177,14 +181,17 @@ jobs:
177181
docker exec -it $(docker container ps --format '{{.ID}}') bash
178182
179183
- name: Checkout repository (${{ inputs.repository || github.repository }}@${{ inputs.ref }})
180-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
184+
uses: zklaus/checkout@4a5ddcafe75fd4cd42b59eff291c317d66eea084 # submodules filter enabled
185+
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
181186
with:
182187
# Support the use case where we need to checkout someone's fork
183188
repository: ${{ inputs.repository || github.repository }}
184189
ref: ${{ inputs.ref || github.ref }}
185190
path: ${{ inputs.repository || github.repository }}
186191
fetch-depth: ${{ inputs.fetch-depth }}
187192
submodules: ${{ inputs.submodules }}
193+
filter: ${{ inputs.checkout-mode == 'blobless' && 'blob:none' || inputs.checkout-mode == 'treeless' && 'tree:0' || null }}
194+
submodules-filter: ${{ inputs.checkout-mode == 'blobless' && 'blob:none' || inputs.checkout-mode == 'treeless' && 'tree:0' || null }}
188195

189196
- name: Calculate docker image
190197
id: calculate-docker-image

.github/workflows/test_linux_job_v2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
runner: linux.2xlarge
2020
test-infra-repository: ${{ github.repository }}
2121
test-infra-ref: ${{ github.ref }}
22+
checkout-mode: "treeless"
2223
submodules: "recursive"
2324
gpu-arch-type: cpu
2425
gpu-arch-version: ""

0 commit comments

Comments
 (0)