unsloth/.github/workflows
Daniel Han ab21dc25b4
tests: public-api surface drift detector (companion to test_import_fixes_drift.py) (#5428)
* tests: ship public-api surface drift detector + wire into Core matrix

Companion to tests/test_import_fixes_drift.py (PR #5414): that file
catches drift in THIRD-PARTY libs (transformers / trl / triton / peft /
vllm / torchcodec / xformers); this file catches drift in unsloth's
OWN public-surface API -- the top-9 classmethods + symbols that
unslothai/notebooks calls at ~2000 cumulative sites.

Closes the gap where a refactor on this repo (e.g. renaming
FastLanguageModel.from_pretrained -> .load) would pass unsloth CI
green and surface only on the next unslothai/notebooks CI run, or
worse, on a user's Colab crash report.

Coverage (call-site counts measured against unslothai/notebooks main):
  test_fast_language_model_class_present
  test_fast_language_model_from_pretrained_kwargs        506 sites
  test_fast_language_model_get_peft_model_kwargs         304 sites
  test_fast_language_model_for_inference_callable        370 sites
  test_fast_vision_model_class_and_methods         (4 methods)
  test_fast_vision_model_get_peft_model_vision_kwargs    (4 kwargs)
  test_fast_model_class_and_methods                (2 methods)
  test_fast_model_from_pretrained_kwargs                 103 sites
  test_is_bf16_supported_or_alias_callable        48 + 8 sites

Each test asserts the healthy public shape via inspect.signature; on
regression fires pytest.fail("DRIFT DETECTED: ...") -- never
pytest.skip -- so the Core matrix cell goes red. Mirrors the same
skeleton used by tests/test_import_fixes_drift.py.

Wired as a new step in consolidated-tests-ci.yml right after the
import_fixes drift step, inside every Core matrix cell.

Local verification on transformers 4.57.6 + unsloth main:
  pytest tests/test_public_api_surface.py -v
  -> 9 passed in 0.02s

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-05-14 19:56:21 -07:00
..
consolidated-tests-ci.yml tests: public-api surface drift detector (companion to test_import_fixes_drift.py) (#5428) 2026-05-14 19:56:21 -07:00
lint-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
mlx-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
notebooks-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
release-desktop.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
security-audit.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
stale.yml CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
studio-api-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-backend-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-frontend-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-inference-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-mac-api-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-mac-inference-smoke.yml studio/ci: flat GGUF+mmproj cache for Mac json-images smoke, save partial caches on cancel (#5417) 2026-05-14 04:27:45 -07:00
studio-mac-ui-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-mac-update-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-tauri-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-ui-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-update-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-api-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-inference-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-ui-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-update-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
version-compat-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
wheel-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00