Bot Tests #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bot Tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: Test environment | |
| required: true | |
| default: staging | |
| type: choice | |
| options: | |
| - staging | |
| - production | |
| run_real_gemini: | |
| description: Run live Gemini tests | |
| required: true | |
| default: false | |
| type: boolean | |
| run_full_stack: | |
| description: Run Render full-stack test | |
| required: true | |
| default: false | |
| type: boolean | |
| run_r2_real: | |
| description: Run R2 real integration tests | |
| required: true | |
| default: false | |
| type: boolean | |
| run_cloudflare: | |
| description: Run Cloudflare tests | |
| required: true | |
| default: false | |
| type: boolean | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.event.inputs.environment }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Run test matrix | |
| shell: bash | |
| env: | |
| BOT_SECRETS_ENV_ONLY: "true" | |
| BOT_ENV: ${{ github.event.inputs.environment }} | |
| RENDER_DEPLOY_METADATA_OUT: telegram/out/deploy-render-metadata.${{ github.event.inputs.environment }}.json | |
| TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
| TELEGRAM_WEBHOOK_SECRET: ${{ secrets.TELEGRAM_WEBHOOK_SECRET }} | |
| TELEGRAM_NOTIFY_CHAT_ID: ${{ secrets.TELEGRAM_NOTIFY_CHAT_ID }} | |
| TELEGRAM_ADMIN_CHAT_IDS: ${{ secrets.TELEGRAM_ADMIN_CHAT_IDS }} | |
| COMICBOT_ALLOWED_CHAT_IDS: ${{ secrets.COMICBOT_ALLOWED_CHAT_IDS }} | |
| TELEGRAM_TEST_CHAT_ID: ${{ secrets.TELEGRAM_TEST_CHAT_ID }} | |
| RENDER_PUBLIC_BASE_URL: ${{ secrets.RENDER_PUBLIC_BASE_URL }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} | |
| HUGGINGFACE_INFERENCE_API_TOKEN: ${{ secrets.HUGGINGFACE_INFERENCE_API_TOKEN }} | |
| COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} | |
| FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }} | |
| JINA_API_KEY: ${{ secrets.JINA_API_KEY }} | |
| DRIFTBOT_API_KEY: ${{ secrets.DRIFTBOT_API_KEY }} | |
| BRAVE_SEARCH_API_KEY: ${{ secrets.BRAVE_SEARCH_API_KEY }} | |
| TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }} | |
| EXA_API_KEY: ${{ secrets.EXA_API_KEY }} | |
| SERPER_API_KEY: ${{ secrets.SERPER_API_KEY }} | |
| SERPAPI_API_KEY: ${{ secrets.SERPAPI_API_KEY }} | |
| GOOGLE_KG_API_KEY: ${{ secrets.GOOGLE_KG_API_KEY }} | |
| LLAMA_CLOUD_API_KEY: ${{ secrets.LLAMA_CLOUD_API_KEY }} | |
| UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }} | |
| ASSEMBLYAI_API_KEY: ${{ secrets.ASSEMBLYAI_API_KEY }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| CLOUDFLARE_WORKERS_AI_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_AI_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_API_TOKEN: ${{ secrets.CLOUDFLARE_ACCOUNT_API_TOKEN }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_AI_TOKEN }} | |
| CLOUDFLARE_WORKER_URL: ${{ secrets.CLOUDFLARE_WORKER_URL }} | |
| R2_S3_ENDPOINT: ${{ secrets.R2_S3_ENDPOINT }} | |
| R2_BUCKET: ${{ secrets.R2_BUCKET }} | |
| R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
| R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
| run: | | |
| set -euo pipefail | |
| npm run secrets:validate:tests:ci | |
| npm run test:render:local | |
| npm run test:render | |
| if [[ "${{ github.event.inputs.run_real_gemini }}" == "true" ]]; then | |
| RUN_RENDER_REAL_GEMINI=1 npm run test:render:gemini-real | |
| fi | |
| if [[ "${{ github.event.inputs.run_r2_real }}" == "true" ]]; then | |
| RUN_R2_E2E=true npm run test:render:r2-real | |
| fi | |
| if [[ "${{ github.event.inputs.run_full_stack }}" == "true" ]]; then | |
| RUN_FULL_STACK_E2E=true npm run test:render:full-stack | |
| fi | |
| if [[ "${{ github.event.inputs.run_cloudflare }}" == "true" ]]; then | |
| npm run test:cloudflare | |
| npm run test:cloudflare:smoke | |
| fi |