Skip to content

Commit 8c95eb3

Browse files
committed
Add checkout mode to linux job v2
1 parent b2d671e commit 8c95eb3

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/linux_job_v2.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ on:
4040
description: 'Number of commits to fetch, defaults to 1 similar to actions/checkout'
4141
default: 1
4242
type: number
43+
single-branch:
44+
description: 'Whether to fetch only a single branch, defaults to true'
45+
default: true
46+
type: boolean
47+
checkout-mode:
48+
description: 'Mode of checkout; one of "normal", "blobless", "treeless".'
49+
default: "normal"
50+
type: string
4351
submodules:
4452
description:
4553
Same as actions/checkout, set to `true` to checkout submodules or `recursive` to
@@ -124,6 +132,7 @@ jobs:
124132
# Will be blank outside of this
125133
PR_NUMBER: ${{ github.event.pull_request.number }}
126134
SCRIPT: ${{ inputs.script }}
135+
filter: ${{ inputs.checkout-mode == 'blobless' && 'blob:none' || inputs.checkout-mode == 'treeless' && 'tree:0' || null }}
127136
runs-on: ${{ inputs.runner }}
128137
# TODO: Eventually this should run in a container, we need to make a container that matches up
129138
# with the users for our self hosted runner infra since using actions/checkout with a root
@@ -177,14 +186,17 @@ jobs:
177186
docker exec -it $(docker container ps --format '{{.ID}}') bash
178187
179188
- name: Checkout repository (${{ inputs.repository || github.repository }}@${{ inputs.ref }})
180-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
189+
uses: ./test-infra/.github/actions/checkout
181190
with:
182191
# Support the use case where we need to checkout someone's fork
183192
repository: ${{ inputs.repository || github.repository }}
184193
ref: ${{ inputs.ref || github.ref }}
194+
single-branch: ${{ inputs.single-branch }}
185195
path: ${{ inputs.repository || github.repository }}
186196
fetch-depth: ${{ inputs.fetch-depth }}
187197
submodules: ${{ inputs.submodules }}
198+
filter: ${{ env.filter }}
199+
submodules-filter: ${{ env.filter }}
188200

189201
- name: Calculate docker image
190202
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)