@@ -35,13 +35,21 @@ jobs:
3535 with :
3636 fetch-depth : 0
3737
38+ - name : Get merge-base commit
39+ id : merge-base
40+ run : |
41+ # Get the merge-base between current branch and main
42+ MERGE_BASE=$(git merge-base HEAD origin/main)
43+ echo "merge-base=$MERGE_BASE" >> $GITHUB_OUTPUT
44+ echo "Merge-base commit: $MERGE_BASE"
45+
3846 - name : Get changed files
3947 id : changed-files
4048 uses : step-security/changed-files@v46
4149 with :
4250 json : true
4351 matrix : true
44- base_sha : main
52+ base_sha : ${{ steps.merge-base.outputs.merge-base }}
4553 dir_names : true
4654 dir_names_max_depth : 2
4755 files : |
@@ -81,24 +89,15 @@ jobs:
8189 fi
8290 fi
8391
84- # Assign Docker images to the selected directories
85- # Currently, AMPLIFY is the only folder that needs a custom base image, since we have to support both TE and
86- # xformers-based models for golden value testing. The rest of the models use the default pytorch image.
87- DIRS_WITH_IMAGES=$(echo "$DIRS" | jq -c '
88- map({
89- dir: .,
90- image: (
91- if . == "models/amplify" then
92- "svcbionemo023/bionemo-framework:amplify-model-devcontainer-082025"
93- else
94- "nvcr.io/nvidia/pytorch:25.06-py3"
95- end
96- )
97- })
98- ')
99- echo "dirs=$DIRS_WITH_IMAGES" >> $GITHUB_OUTPUT
92+ echo "dirs=$DIRS" >> $GITHUB_OUTPUT
10093 - name : Show output
10194 run : |
95+ echo "=== Changed Files Analysis ==="
96+ echo "Current branch: ${{ github.ref_name }}"
97+ echo "Merge-base commit: ${{ steps.merge-base.outputs.merge-base }}"
98+ echo "Changed files compared to merge-base:"
99+ echo '${{ steps.changed-files.outputs.all_changed_files }}' | jq -r '.[]' | sed 's/^/ - /'
100+ echo "Total changed files: $(echo '${{ steps.changed-files.outputs.all_changed_files }}' | jq '. | length')"
102101 echo '${{ toJSON(steps.changed-files.outputs) }}'
103102 echo '${{ toJSON(steps.set-dirs.outputs) }}'
104103 shell : bash
@@ -107,40 +106,31 @@ jobs:
107106 needs : changed-dirs
108107 runs-on : linux-amd64-gpu-l4-latest-1
109108 if : ${{ needs.changed-dirs.outputs.dirs != '[]' }}
110- container :
111- image : ${{ matrix.recipe.image }}
112- strategy :
113- matrix :
114- recipe : ${{ fromJson(needs.changed-dirs.outputs.dirs) }}
115- fail-fast : false
116109
117110 steps :
118111 - name : Setup proxy cache
119112 uses : nv-gha-runners/setup-proxy-cache@main
113+
120114 - name : Checkout repository
121115 uses : actions/checkout@v4
116+
117+ - name : Setup python
118+ uses : actions/setup-python@v5
122119 with :
123- sparse-checkout : " ${{ matrix.recipe.dir }}"
124- sparse-checkout-cone-mode : false
120+ python-version : " 3.12"
125121
126- - name : Install dependencies
127- working-directory : ${{ matrix.recipe.dir }}
128- #
122+ - name : Install ci script dependencies
129123 run : |
130- if [ -f pyproject.toml ] || [ -f setup.py ]; then
131- PIP_CONSTRAINT= pip install -e .
132- echo "Installed ${{ matrix.recipe.dir }} as editable package"
133- elif [ -f requirements.txt ]; then
134- PIP_CONSTRAINT= pip install -r requirements.txt
135- echo "Installed ${{ matrix.recipe.dir }} from requirements.txt"
136- else
137- echo "No pyproject.toml, setup.py, or requirements.txt found in ${{ matrix.recipe.dir }}"
138- exit 1
139- fi
124+ python -m pip install --upgrade pip
125+ pip install platformdirs
140126
141127 - name : Run tests
142- working-directory : ${{ matrix.recipe.dir }}
143- run : pytest -v .
128+ env :
129+ DIRS_JSON : ${{ needs.changed-dirs.outputs.dirs }}
130+ run : |
131+ # Convert JSON array to space-separated arguments
132+ DIRS_ARGS=$(echo "$DIRS_JSON" | jq -r '.[]' | tr '\n' ' ')
133+ ./ci/scripts/recipes_local_test.py $DIRS_ARGS
144134
145135 verify-recipe-tests :
146136 # This job checks the status of the unit-tests matrix and fails if any matrix job failed or was cancelled.
0 commit comments