Skip to content

Commit 5e71f32

Browse files
committed
add option for PR label
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
1 parent 23ca6a7 commit 5e71f32

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/unit-tests-recipes.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
dirs: ${{ steps.set-dirs.outputs.dirs }}
2828

2929
steps:
30+
- id: get-pr-info
31+
uses: nv-gha-runners/get-pr-info@main
32+
3033
- uses: actions/checkout@v4
3134
with:
3235
fetch-depth: 0
@@ -37,7 +40,7 @@ jobs:
3740
with:
3841
json: true
3942
matrix: true
40-
base_sha: main
43+
base_sha: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
4144
dir_names: true
4245
dir_names_max_depth: 2
4346
files: |
@@ -52,6 +55,9 @@ jobs:
5255
# Determine which directories to run: all for schedule, filtered for other events
5356
if [[ "${{ github.event_name }}" == "schedule" ]]; then
5457
DIRS="$ALL_DIRS"
58+
elif [[ '${{ steps.get-pr-info.outputs.pr-info }}' != 'null' ]] && echo '${{ steps.get-pr-info.outputs.pr-info }}' | jq -e '.labels[]? | select(.name == "INCLUDE_ALL_RECIPES")' > /dev/null 2>&1; then
59+
echo "Found INCLUDE_ALL_RECIPES label - running all directories"
60+
DIRS="$ALL_DIRS"
5561
else
5662
CHANGED_FILES='${{ steps.changed-files.outputs.all_changed_files }}'
5763
# Filter directories to only those that have changed files
@@ -80,6 +86,7 @@ jobs:
8086
run: |
8187
echo '${{ toJSON(steps.changed-files.outputs) }}'
8288
echo '${{ toJSON(steps.set-dirs.outputs) }}'
89+
echo '${{ toJSON(steps.get-pr-info.outputs.pr-info) }}'
8390
shell:
8491
bash
8592

@@ -95,6 +102,8 @@ jobs:
95102
fail-fast: false
96103

97104
steps:
105+
- name: Setup proxy cache
106+
uses: nv-gha-runners/setup-proxy-cache@main
98107
- name: Checkout repository
99108
uses: actions/checkout@v4
100109
with:

0 commit comments

Comments
 (0)