Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | name: Docs - Tests |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | paths: |
| 6 | - 'docs/**' |
| 7 | - '.github/actions/setup-node-pnpm-bun/action.yml' |
| 8 | - '.github/workflows/docs-update-data.yml' |
| 9 | - '.github/workflows/docs-rebuild-kb-semantic.yml' |
| 10 | - '.github/workflows/docs-tests.yml' |
| 11 | - 'mise.toml' |
| 12 | - 'mise.lock' |
| 13 | |
| 14 | concurrency: |
| 15 | group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} |
| 16 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 17 | |
| 18 | permissions: |
| 19 | contents: read |
| 20 | |
| 21 | jobs: |
| 22 | test: |
| 23 | # This job installs the published SDK packages. A release PR checks its docs against the |
| 24 | # packages it will publish instead, in the `SDK candidate docs` check. |
| 25 | if: ${{ !startsWith(github.head_ref, 'sdk-release/batch-') }} |
| 26 | runs-on: ubuntu-latest |
| 27 | defaults: |
| 28 | run: |
| 29 | working-directory: ./docs |
| 30 | |
| 31 | steps: |
| 32 | - name: Checkout repository |
| 33 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 34 | with: |
| 35 | # Source freshness needs real per-file history, not checkout time. |
| 36 | fetch-depth: 0 |
| 37 | |
| 38 | - name: Setup Node.js, pnpm, Bun |
| 39 | uses: ./.github/actions/setup-node-pnpm-bun |
| 40 | |
| 41 | - name: Cache bun dependencies |
| 42 | uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| 43 | with: |
| 44 | path: ~/.bun/install/cache |
| 45 | key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }} |
| 46 | restore-keys: | |
| 47 | ${{ runner.os }}-bun- |
| 48 | |
| 49 | - name: Install dependencies |
| 50 | run: bun install |
| 51 | |
| 52 | - name: Run static tests |
| 53 | run: bun run test |
| 54 | |
| 55 | - name: Check KB semantic artifact |
| 56 | run: bun run check:kb-semantic --allow-stale |
| 57 | |
| 58 | - name: Build |
| 59 | run: bun run build |
| 60 | |
| 61 | - name: Start server and run integration tests |
| 62 | run: | |
| 63 | bun run start & |
| 64 | SERVER_PID=$! |
| 65 | |
| 66 | echo "Waiting for server to start..." |
| 67 | for i in $(seq 1 30); do |
| 68 | if curl -s http://localhost:3000 > /dev/null 2>&1; then |
| 69 | echo "Server is ready!" |
| 70 | break |
| 71 | fi |
| 72 | if [ $i -eq 30 ]; then |
| 73 | echo "Server failed to start within 30 seconds" |
| 74 | kill $SERVER_PID 2>/dev/null || true |
| 75 | exit 1 |
| 76 | fi |
| 77 | sleep 1 |
| 78 | done |
| 79 | |
| 80 | set +e |
| 81 | bun run test:integration |
| 82 | TEST_EXIT=$? |
| 83 | set -e |
| 84 | |
| 85 | kill $SERVER_PID 2>/dev/null || true |
| 86 | exit $TEST_EXIT |