File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 6
6
- main
7
7
8
8
jobs :
9
+ check-changes :
10
+ runs-on : ubuntu-latest
11
+ outputs :
12
+ RUN_TESTS : ${{ steps.check_changes.outputs.RUN_TESTS }}
13
+
14
+ steps :
15
+ - name : Checkout Repository
16
+ uses : actions/checkout@v4
17
+ with :
18
+ fetch-depth : 2 # Ensure we have commit history for comparison
19
+
20
+ - name : Check Modified Files
21
+ id : check_changes
22
+ run : |
23
+ git fetch origin main --depth=2
24
+ CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
25
+
26
+ # Check if cli_monitor.py or tests/ directory has been changed
27
+ if echo "$CHANGED_FILES" | grep -qE '^(cli_monitor.py|tests/)'; then
28
+ echo "RUN_TESTS=true" >> $GITHUB_ENV
29
+ echo "RUN_TESTS=true" >> $GITHUB_OUTPUT
30
+ else
31
+ echo "RUN_TESTS=false" >> $GITHUB_ENV
32
+ echo "RUN_TESTS=false" >> $GITHUB_OUTPUT
33
+ fi
34
+
9
35
test :
36
+ needs : check-changes
37
+ if : needs.check-changes.outputs.RUN_TESTS == 'true' # Skip if no relevant changes
10
38
runs-on : ${{ matrix.os }}
11
39
strategy :
12
40
matrix :
43
71
with :
44
72
name : TEST_RESULT_${{ matrix.os }}_${{ matrix.python-version }}
45
73
path : test-results/
46
- retention-days : 1
74
+ retention-days : 1
You can’t perform that action at this time.
0 commit comments