File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ concurrency:
2424
2525jobs :
2626 build :
27-
2827 runs-on : ${{ matrix.os }}
2928 strategy :
3029 fail-fast : false
3332 python-version : ["3.9", "3.10", "3.11"]
3433 steps :
3534 - uses : actions/checkout@v4
35+ with :
36+ fetch-depth : 0 # Required to get full history for diff
37+ - name : Check for relevant file changes
38+ id : changes
39+ run : |
40+ echo "Changed files:"
41+ git fetch origin main
42+ CHANGED_FILES=$(git diff --name-only origin/main...HEAD)
43+ echo "$CHANGED_FILES"
44+
45+ MATCH=$(echo "$CHANGED_FILES" | grep -E '^flaml/|^test/|^notebook/|^setup.py|^\.github/workflows/python-package.yml' || true)
46+
47+ if [ -z "$MATCH" ]; then
48+ echo "No relevant changes detected. Skipping build."
49+ echo "skip=true" >> $GITHUB_OUTPUT
50+ else
51+ echo "Relevant changes detected. Proceeding with build."
52+ echo "skip=false" >> $GITHUB_OUTPUT
53+ fi
54+ - name : Stop early if no relevant changes
55+ if : steps.changes.outputs.skip == 'true'
56+ run : echo "Skipping rest of the build job." && exit 0
3657 - name : Set up Python ${{ matrix.python-version }}
3758 uses : actions/setup-python@v5
3859 with :
You can’t perform that action at this time.
0 commit comments