@@ -16,7 +16,27 @@ concurrency:
1616 cancel-in-progress : true
1717
1818jobs :
19+ changes :
20+ runs-on : ubuntu-22.04
21+ outputs :
22+ code_related : ${{ steps.filter.outputs.code_related }}
23+ steps :
24+ - uses : actions/checkout@v5
25+
26+ - name : Detect code-related changes
27+ id : filter
28+ uses : dorny/paths-filter@v3
29+ with :
30+ filters : |
31+ code_related:
32+ - 'deepctr/**'
33+ - 'tests/**'
34+ - 'setup.py'
35+ - 'setup.cfg'
36+ - '.github/workflows/**'
37+
1938 build :
39+ needs : changes
2040 runs-on : ubuntu-22.04
2141 timeout-minutes : 180
2242 strategy :
@@ -45,14 +65,21 @@ jobs:
4565 TF_USE_LEGACY_KERAS : ${{ matrix.use-legacy-keras }}
4666
4767 steps :
68+ - name : Docs-only PR fast-path
69+ if : ${{ github.event_name == 'pull_request' && needs.changes.outputs.code_related != 'true' }}
70+ run : echo "Docs-only PR detected; skipping heavy CI steps."
71+
4872 - uses : actions/checkout@v5
73+ if : ${{ github.event_name != 'pull_request' || needs.changes.outputs.code_related == 'true' }}
4974
5075 - name : Setup python environment
76+ if : ${{ github.event_name != 'pull_request' || needs.changes.outputs.code_related == 'true' }}
5177 uses : actions/setup-python@v6
5278 with :
5379 python-version : ${{ matrix.python-version }}
5480
5581 - name : Install dependencies
82+ if : ${{ github.event_name != 'pull_request' || needs.changes.outputs.code_related == 'true' }}
5683 run : |
5784 python -m pip install -q --upgrade pip setuptools wheel
5885 python -m pip install -q "numpy<2"
@@ -65,11 +92,13 @@ jobs:
6592 python -m pip check
6693
6794 - name : Test with pytest
95+ if : ${{ github.event_name != 'pull_request' || needs.changes.outputs.code_related == 'true' }}
6896 timeout-minutes : 180
6997 run : |
7098 pytest --cov=deepctr --cov-report=xml --cov-report=term-missing:skip-covered
7199
72100 - name : Upload coverage to Codecov
101+ if : ${{ github.event_name != 'pull_request' || needs.changes.outputs.code_related == 'true' }}
73102 uses : codecov/codecov-action@v6
74103 with :
75104 token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments