Skip to content

Commit 0c2bc7c

Browse files
committed
non unit tests trigger
1 parent 3b207c5 commit 0c2bc7c

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,31 @@ env:
2828

2929
jobs:
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

0 commit comments

Comments
 (0)