File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 2828
2929jobs :
3030
31+ determine-changes :
32+ runs-on : ubuntu-latest
33+ outputs :
34+ all-changes : ${{ steps.all-changes.outputs.all-changes }}
35+ non-test-changes : ${{ steps.non-test-changes.outputs.non-test-changes }}
36+ steps :
37+ - name : Checkout Code
38+ uses : actions/checkout@v3
39+
40+ - name : Determine All Changes
41+ id : all-changes
42+ run : |
43+ git fetch origin ${{ github.base_ref }} --depth=1
44+ ALL_CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }})
45+ echo "ALL_CHANGED_FILES=$ALL_CHANGED_FILES"
46+ echo "::set-output name=all-changes::$ALL_CHANGED_FILES"
47+
48+ - name : Filter Non-Test Changes
49+ id : non-test-changes
50+ run : |
51+ echo "All Changed Files: ${{ steps.all-changes.outputs.all-changes }}"
52+ NON_TEST_CHANGES=$(echo "${{ steps.all-changes.outputs.all-changes }}" | grep -v '^tests/' || true)
53+ echo "NON_TEST_CHANGES=$NON_TEST_CHANGES"
54+ echo "::set-output name=non-test-changes::$NON_TEST_CHANGES"
55+
3156 test :
3257 runs-on : ubuntu-latest
3358 strategy :
@@ -120,8 +145,9 @@ jobs:
120145 cache-to : ${{ steps.registry_refs.outputs.tags }},mode=max
121146
122147 integration-tests :
123- needs : [test , lint, build-container]
148+ needs : [determine-changes , lint, test , build-container]
124149 runs-on : ubuntu-latest
150+ if : ${{ needs.determine-changes.outputs.non-test-changes }}
125151 steps :
126152 - name : Checkout repository
127153 uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments