Files
openmlsys-zh/tests/test_update_docs_workflow.py
cydia2001 b938d3824e ci: use official pages deployment workflow
Switch the docs deployment workflow to the official GitHub Pages actions flow and verify it uses Pages action outputs for the deployment URL.
2026-03-11 01:10:46 +00:00

25 lines
892 B
Python

from __future__ import annotations
import unittest
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
WORKFLOW_PATH = REPO_ROOT / ".github" / "workflows" / "update_docs.yml"
class UpdateDocsWorkflowTests(unittest.TestCase):
def test_workflow_uses_official_pages_actions_and_page_variables(self) -> None:
workflow = WORKFLOW_PATH.read_text(encoding="utf-8")
self.assertIn("uses: actions/configure-pages@v5", workflow)
self.assertIn("uses: actions/upload-pages-artifact@v4", workflow)
self.assertIn("uses: actions/deploy-pages@v4", workflow)
self.assertIn("url: ${{ steps.deployment.outputs.page_url }}", workflow)
self.assertIn("${{ steps.pages.outputs.base_url }}", workflow)
self.assertNotIn("git clone https://x-access-token:${DEPLOY_TOKEN}", workflow)
if __name__ == "__main__":
unittest.main()