api-model-runtime-tests.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Run Pytest
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. push:
  7. branches:
  8. - deploy/dev
  9. - feat/model-runtime
  10. jobs:
  11. test:
  12. runs-on: ubuntu-latest
  13. env:
  14. OPENAI_API_KEY: sk-IamNotARealKeyJustForMockTestKawaiiiiiiiiii
  15. AZURE_OPENAI_API_BASE: https://difyai-openai.openai.azure.com
  16. AZURE_OPENAI_API_KEY: xxxxb1707exxxxxxxxxxaaxxxxxf94
  17. ANTHROPIC_API_KEY: sk-ant-api11-IamNotARealKeyJustForMockTestKawaiiiiiiiiii-NotBaka-ASkksz
  18. CHATGLM_API_BASE: http://a.abc.com:11451
  19. XINFERENCE_SERVER_URL: http://a.abc.com:11451
  20. XINFERENCE_GENERATION_MODEL_UID: generate
  21. XINFERENCE_CHAT_MODEL_UID: chat
  22. XINFERENCE_EMBEDDINGS_MODEL_UID: embedding
  23. XINFERENCE_RERANK_MODEL_UID: rerank
  24. GOOGLE_API_KEY: abcdefghijklmnopqrstuvwxyz
  25. HUGGINGFACE_API_KEY: hf-awuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwuwu
  26. HUGGINGFACE_TEXT_GEN_ENDPOINT_URL: a
  27. HUGGINGFACE_TEXT2TEXT_GEN_ENDPOINT_URL: b
  28. HUGGINGFACE_EMBEDDINGS_ENDPOINT_URL: c
  29. MOCK_SWITCH: true
  30. steps:
  31. - name: Checkout code
  32. uses: actions/checkout@v4
  33. - name: Set up Python
  34. uses: actions/setup-python@v5
  35. with:
  36. python-version: '3.10'
  37. cache: 'pip'
  38. cache-dependency-path: ./api/requirements.txt
  39. - name: Install dependencies
  40. run: pip install -r ./api/requirements.txt
  41. - name: Run pytest
  42. run: pytest api/tests/integration_tests/model_runtime/anthropic api/tests/integration_tests/model_runtime/azure_openai api/tests/integration_tests/model_runtime/openai api/tests/integration_tests/model_runtime/chatglm api/tests/integration_tests/model_runtime/google api/tests/integration_tests/model_runtime/xinference api/tests/integration_tests/model_runtime/huggingface_hub/test_llm.py