diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 83b57ac..c68a43f 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -1,17 +1,10 @@ name: E2E CLI Tests on: - workflow_run: - workflows: ["Publish Alpha"] - types: - - completed - branches: - - main + workflow_call: jobs: e2e-test: - # Only run if publish-alpha succeeded - if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - uses: actions/setup-node@v4 @@ -47,7 +40,7 @@ jobs: - name: Deploy id: deploy working-directory: test-mcp-app - run: leanmcp deploy . --yes --subdomain ci-test-${{ github.event.workflow_run.id }} + run: leanmcp deploy . --yes --subdomain ci-test-${{ github.run_id }} # 6. Verify URL - name: Verify URL @@ -68,12 +61,12 @@ jobs: working-directory: test-mcp-app run: leanmcp deploy . --yes - # 9. Verify URL after update + # 9. Verify URL after update (with delay for propagation) - name: Verify URL After Update working-directory: test-mcp-app run: | URL=$(cat .leanmcp/config.json | jq -r '.url') - curl -f "$URL" --retry 3 --retry-delay 5 + curl -f "$URL" --retry 5 --retry-delay 5 --retry-all-errors # 10. Health Check after update - name: Health Check After Update diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index fcc4641..3166268 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -4,9 +4,16 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: publish-alpha: + # Run on main push OR PRs from KushagraAgarwal525 + if: | + github.event_name == 'push' || + github.event.pull_request.user.login == 'KushagraAgarwal525' runs-on: ubuntu-latest steps: @@ -135,3 +142,8 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} SHORT_SHA: ${{ steps.sha.outputs.short }} + + call-e2e: + needs: publish-alpha + uses: ./.github/workflows/e2e-tests.yml + secrets: inherit diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index 45034e0..e51b048 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -20,10 +20,13 @@ async function runTypeScriptCompiler(cwd: string): Promise { await execa('npx', ['tsc'], { cwd, preferLocal: true, - all: true, // Combine stdout + stderr into error.all + // Must use 'pipe' to capture output (default 'inherit' doesn't capture) + stdout: 'pipe', + stderr: 'pipe', + all: true, // Combine stdout + stderr into result.all }); } catch (error: any) { - // execa includes full output in error.all + // execa includes full output in error.all when piped const output = error.all || error.stdout || error.stderr || error.message; throw new Error(output || `tsc exited with code ${error.exitCode}`); }