api-model-runtime-tests.yml 1.7 KB

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