@@ -146,12 +146,38 @@ jobs:
146146 echo "No changed files to check."
147147 fi
148148
149+ # ===========================================================================
150+ # STAGE 1.5: API smoke tests (gate — blocks all further tests on failure)
151+ # ===========================================================================
152+ api-smoke-tests :
153+ name : api-smoke-tests
154+ needs : [code-quality]
155+ runs-on : ubuntu-latest
156+ timeout-minutes : 5
157+
158+ steps :
159+ - uses : actions/checkout@v4
160+
161+ - name : Set up Python 3.11
162+ uses : actions/setup-python@v5
163+ with :
164+ python-version : " 3.11"
165+
166+ - name : Install dependencies
167+ run : |
168+ python -m pip install --no-cache-dir --upgrade pip
169+ python -m pip install --no-cache-dir -e .[test]
170+
171+ - name : Run API smoke tests
172+ run : |
173+ python -m pytest tests/test_smoke_api.py -v -p no:warnings
174+
149175 # ===========================================================================
150176 # STAGE 2: Targeted tests (only for changed areas, fast feedback)
151177 # ===========================================================================
152178 targeted-core :
153179 name : targeted-core
154- needs : [code-quality , detect-changes]
180+ needs : [api-smoke-tests , detect-changes]
155181 if : needs.detect-changes.outputs.core == 'true' || needs.detect-changes.outputs.any_src == 'false'
156182 runs-on : ubuntu-latest
157183 timeout-minutes : 10
@@ -175,7 +201,7 @@ jobs:
175201
176202 targeted-sklearn :
177203 name : targeted-sklearn
178- needs : [code-quality , detect-changes]
204+ needs : [api-smoke-tests , detect-changes]
179205 if : needs.detect-changes.outputs.sklearn == 'true'
180206 runs-on : ubuntu-latest
181207 timeout-minutes : 10
@@ -199,7 +225,7 @@ jobs:
199225
200226 targeted-sktime :
201227 name : targeted-sktime
202- needs : [code-quality , detect-changes]
228+ needs : [api-smoke-tests , detect-changes]
203229 if : needs.detect-changes.outputs.sktime == 'true'
204230 runs-on : ubuntu-latest
205231 timeout-minutes : 10
@@ -223,7 +249,7 @@ jobs:
223249
224250 targeted-skpro :
225251 name : targeted-skpro
226- needs : [code-quality , detect-changes]
252+ needs : [api-smoke-tests , detect-changes]
227253 if : needs.detect-changes.outputs.skpro == 'true'
228254 runs-on : ubuntu-latest
229255 timeout-minutes : 10
@@ -247,7 +273,7 @@ jobs:
247273
248274 targeted-utils :
249275 name : targeted-utils
250- needs : [code-quality , detect-changes]
276+ needs : [api-smoke-tests , detect-changes]
251277 if : needs.detect-changes.outputs.utils == 'true'
252278 runs-on : ubuntu-latest
253279 timeout-minutes : 10
@@ -272,18 +298,25 @@ jobs:
272298 # Gate job: passes if all targeted tests pass OR are skipped (not failed)
273299 targeted-tests-gate :
274300 name : targeted-tests-gate
275- needs : [targeted-core, targeted-sklearn, targeted-sktime, targeted-skpro, targeted-utils]
301+ needs : [api-smoke-tests, targeted-core, targeted-sklearn, targeted-sktime, targeted-skpro, targeted-utils]
276302 if : always()
277303 runs-on : ubuntu-latest
278304 steps :
279- - name : Check targeted test results
305+ - name : Check results
280306 run : |
307+ echo "API smoke tests: ${{ needs.api-smoke-tests.result }}"
281308 echo "Core: ${{ needs.targeted-core.result }}"
282309 echo "Sklearn: ${{ needs.targeted-sklearn.result }}"
283310 echo "Sktime: ${{ needs.targeted-sktime.result }}"
284311 echo "Skpro: ${{ needs.targeted-skpro.result }}"
285312 echo "Utils: ${{ needs.targeted-utils.result }}"
286313
314+ # Fail if API smoke tests did not succeed
315+ if [[ "${{ needs.api-smoke-tests.result }}" != "success" ]]; then
316+ echo "API smoke tests failed — blocking pipeline"
317+ exit 1
318+ fi
319+
287320 # Fail if any targeted test failed (not skipped)
288321 if [[ "${{ needs.targeted-core.result }}" == "failure" ]] || \
289322 [[ "${{ needs.targeted-sklearn.result }}" == "failure" ]] || \
@@ -293,7 +326,7 @@ jobs:
293326 echo "One or more targeted tests failed"
294327 exit 1
295328 fi
296- echo "All targeted tests passed or were skipped "
329+ echo "All gates passed"
297330
298331 # ===========================================================================
299332 # STAGE 3: Full test matrix (only after targeted tests pass)
@@ -433,6 +466,7 @@ jobs:
433466 - name : Upload coverage to Codecov
434467 uses : codecov/codecov-action@v5
435468 with :
469+ token : ${{ secrets.CODECOV_TOKEN }}
436470 files : ./coverage.xml
437471 fail_ci_if_error : false
438472 verbose : true
0 commit comments