Support separate Slack bot identities in the same workspace #303
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| llmPlatform: | |
| description: 'The LLM Platform to use for agent testing' | |
| required: true | |
| default: 'bedrock' | |
| type: choice | |
| options: | |
| - 'openai' | |
| - 'bedrock' | |
| - 'vllm' | |
| - 'google' | |
| llmModel: | |
| description: 'The LLM Model to use for agent testing' | |
| required: true | |
| default: 'us.anthropic.claude-sonnet-4-6' | |
| type: string | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| services: | |
| mongodb: | |
| image: mongo:8.0 | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd "mongosh --quiet --eval 'db.runCommand({ping: 1})'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| chromadb: | |
| image: chromadb/chroma:0.6.3 | |
| ports: | |
| - 8000:8000 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Detect Agent Changes | |
| uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| list-files: shell | |
| filters: | | |
| helpers_src: | |
| - 'src/agents/helpers/**' | |
| tools_src: | |
| - 'src/agents/tools/**' | |
| agents: | |
| - 'src/agents/*/**' | |
| - 'tests/agents/*/**' | |
| - name: Setup Node.js 22.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| - name: Enable Yarn | |
| run: corepack enable | |
| - name: Get yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
| - name: Cache yarn dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build and verify app starts | |
| run: | | |
| echo "Building application..." | |
| yarn build:up & | |
| BUILD_PID=$! | |
| cleanup_build() { | |
| if kill -0 $BUILD_PID 2>/dev/null; then | |
| echo "Stopping build process (PID: $BUILD_PID)" | |
| kill $BUILD_PID | |
| wait $BUILD_PID 2>/dev/null || true | |
| fi | |
| } | |
| # Set trap to ensure cleanup happens on script exit | |
| trap cleanup_build EXIT | |
| echo "Waiting for app health check to pass..." | |
| HEALTH_CHECK_PASSED=false | |
| for i in {1..10}; do | |
| if curl --fail --silent http://localhost:3000/v1/health; then | |
| echo "App is healthy" | |
| HEALTH_CHECK_PASSED=true | |
| break | |
| else | |
| echo "Health check failed (try $i), retrying..." | |
| sleep 3 | |
| fi | |
| done | |
| if [ "$HEALTH_CHECK_PASSED" = true ]; then | |
| echo "App started successfully" | |
| exit 0 | |
| else | |
| echo "App failed health check after restart" | |
| exit 1 | |
| fi | |
| env: | |
| PORT: 3000 | |
| MONGODB_URL: mongodb://127.0.0.1:27017/node-boilerplate | |
| JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
| CHROMA_DB_URL: http://0.0.0.0:8000 | |
| DEFAULT_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| DEFAULT_OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
| - name: Run linting | |
| run: yarn lint | |
| - name: Check code formatting | |
| run: yarn prettier | |
| - name: Security audit (critical vulnerabilities) | |
| run: yarn audit:critical | |
| - name: Security audit (high vulnerabilities) | |
| run: yarn audit:high | |
| continue-on-error: true | |
| - name: Run tests | |
| run: yarn test | |
| env: | |
| PORT: 3000 | |
| MONGODB_URL: mongodb://127.0.0.1:27017/node-boilerplate | |
| JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
| CHROMA_DB_URL: http://0.0.0.0:8000 | |
| DEFAULT_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| DEFAULT_OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
| BEDROCK_API_KEY: ${{ secrets.BEDROCK_API_KEY }} | |
| BEDROCK_BASE_URL: ${{ secrets.BEDROCK_BASE_URL }} | |
| - name: Run agent tests | |
| if: steps.changes.outputs.helpers_src == 'true' || steps.changes.outputs.tools_src == 'true' || steps.changes.outputs.agents == 'true' || github.event_name == 'workflow_dispatch' | |
| run: | | |
| # If helper or tools source code changed, run all agent tests | |
| if [ "${{ steps.changes.outputs.helpers_src }}" == "true" ] || [ "${{ steps.changes.outputs.tools_src }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| echo "Helper/tools source code changed or manual trigger - running all agent tests" | |
| yarn test:agents | |
| else | |
| # Extract unique agent folder names from changed files | |
| CHANGED_FILES="${{ steps.changes.outputs.agents_files }}" | |
| echo "Changed files: $CHANGED_FILES" | |
| # Extract agent folder names and build unique list | |
| AGENT_NAMES=$(echo "$CHANGED_FILES" | tr ' ' '\n' | grep -E '(src|tests)/agents/' | sed -E 's#(src|tests)/agents/([^/]+)/.*#\2#' | sort -u) | |
| if [ -z "$AGENT_NAMES" ]; then | |
| echo "No agent tests to run" | |
| exit 0 | |
| fi | |
| # Build test paths | |
| TEST_PATHS="" | |
| for agent in $AGENT_NAMES; do | |
| TEST_PATHS="$TEST_PATHS tests/agents/$agent" | |
| done | |
| echo "Running tests for changed agents: $TEST_PATHS" | |
| yarn test:agents $TEST_PATHS | |
| fi | |
| env: | |
| PORT: 3000 | |
| MONGODB_URL: mongodb://127.0.0.1:27017/node-boilerplate | |
| JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
| CHROMA_DB_URL: http://0.0.0.0:8000 | |
| DEFAULT_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| DEFAULT_OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
| BEDROCK_API_KEY: ${{ secrets.BEDROCK_API_KEY }} | |
| BEDROCK_BASE_URL: ${{ secrets.BEDROCK_BASE_URL }} | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| GOOGLE_BASE_URL: ${{ secrets.GOOGLE_BASE_URL }} | |
| SEMANTIC_SCHOLAR_API_KEY: ${{ secrets.SEMANTIC_SCHOLAR_API_KEY }} | |
| VLLM_API_URL: ${{ secrets.VLLM_API_URL }} | |
| VLLM_API_KEY: ${{ secrets.VLLM_API_KEY }} | |
| TEST_LLM_PLATFORM: ${{ github.event.inputs.llmPlatform || 'bedrock'}} | |
| TEST_LLM_MODEL: ${{ github.event.inputs.llmModel || 'us.anthropic.claude-sonnet-4-6' }} | |
| ENABLE_AGENT_PERSONALITY: true |