diff --git a/.changeset/fix-integration-ci-affected.md b/.changeset/fix-integration-ci-affected.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/fix-integration-ci-affected.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da6b80dcfed..7fa3228c511 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -356,8 +356,7 @@ jobs: fi jq --version - - name: Task Status - id: task-status + - name: Validate turbo task env: E2E_APP_CLERK_JS_DIR: ${{runner.temp}} E2E_APP_CLERK_UI_DIR: ${{runner.temp}} @@ -367,32 +366,41 @@ jobs: E2E_PROJECT: ${{ matrix.test-project }} INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} run: | - # Use turbo's built-in --affected flag to detect changes - # This automatically uses GITHUB_BASE_REF in GitHub Actions - TASK_COUNT=$(pnpm turbo run test:integration:${{ matrix.test-name }} --affected --dry=json 2>/dev/null | jq '.tasks | length' 2>/dev/null || echo "0") + # Validate the turbo task exists. Turbo's --affected flag is a no-op for + # root-level tasks (//#) — they are always returned as affected. The previous + # --affected check only served to silently skip tests when the task was missing + # from turbo.json, hiding real configuration errors. + TASK_NAME="test:integration:${{ matrix.test-name }}" + TURBO_STDERR=$(mktemp) + if ! TURBO_JSON=$(pnpm turbo run "$TASK_NAME" --dry=json 2>"$TURBO_STDERR"); then + echo "::error::Turbo task '$TASK_NAME' failed validation" + cat "$TURBO_STDERR" + exit 1 + fi - if [ "$TASK_COUNT" -gt 0 ]; then - AFFECTED=1 - else - AFFECTED=0 + if ! TASK_COUNT=$(jq -er '.tasks | length' <<< "$TURBO_JSON"); then + echo "::error::Turbo task '$TASK_NAME' returned invalid JSON or missing .tasks" + printf '%s\n' "$TURBO_JSON" + exit 1 + fi + + if [ "$TASK_COUNT" -eq 0 ]; then + echo "::error::Turbo task '$TASK_NAME' returned 0 tasks" + exit 1 fi - echo "affected=${AFFECTED}" - echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT + echo "Task '$TASK_NAME' validated ($TASK_COUNT tasks in graph)" - name: Build packages - if: ${{ steps.task-status.outputs.affected == '1' }} run: pnpm turbo build $TURBO_ARGS --only - name: Publish to local registry - if: ${{ steps.task-status.outputs.affected == '1' }} run: pkglab pub --force - name: Edit .npmrc [link-workspace-packages=false] run: sed -i -E 's/link-workspace-packages=(deep|true)/link-workspace-packages=false/' .npmrc - name: Install @clerk/clerk-js in os temp - if: ${{ steps.task-status.outputs.affected == '1' }} working-directory: ${{runner.temp}} run: | mkdir clerk-js && cd clerk-js @@ -400,7 +408,6 @@ jobs: pkglab add @clerk/clerk-js - name: Install @clerk/ui in os temp - if: ${{ steps.task-status.outputs.affected == '1' }} working-directory: ${{runner.temp}} run: | mkdir clerk-ui && cd clerk-ui @@ -412,7 +419,6 @@ jobs: run: cd packages/astro && pnpm copy:components - name: Write all ENV certificates to files in integration/certs - if: ${{ steps.task-status.outputs.affected == '1' }} uses: actions/github-script@v7 env: INTEGRATION_CERTS: "${{secrets.INTEGRATION_CERTS}}" @@ -430,12 +436,10 @@ jobs: } - name: LS certs - if: ${{ steps.task-status.outputs.affected == '1' }} working-directory: ./integration/certs run: ls -la && pwd - name: Run Integration Tests - if: ${{ steps.task-status.outputs.affected == '1' }} id: integration-tests timeout-minutes: 25 run: pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS diff --git a/turbo.json b/turbo.json index 9378cc8b73b..756bb2032c0 100644 --- a/turbo.json +++ b/turbo.json @@ -216,6 +216,11 @@ "inputs": ["integration/**"], "outputLogs": "new-only" }, + "//#test:integration:fastify": { + "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], + "inputs": ["integration/**"], + "outputLogs": "new-only" + }, "//#test:integration:hono": { "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], "inputs": ["integration/**"],