diff --git a/.github/workflows/lint-js-and-ruby.yml b/.github/workflows/lint-js-and-ruby.yml index a4138195ac..28203f822b 100644 --- a/.github/workflows/lint-js-and-ruby.yml +++ b/.github/workflows/lint-js-and-ruby.yml @@ -23,14 +23,29 @@ jobs: run_ruby_tests: ${{ steps.detect.outputs.run_ruby_tests }} run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} + has_full_ci_label: ${{ steps.check-label.outputs.result }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false + - name: Check for full-ci label + id: check-label + uses: ./.github/actions/check-full-ci-label - name: Detect relevant changes id: detect run: | + # If full-ci label is present, run everything + if [ "${{ steps.check-label.outputs.result }}" = "true" ]; then + echo "run_lint=true" >> "$GITHUB_OUTPUT" + echo "run_js_tests=true" >> "$GITHUB_OUTPUT" + echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT" + echo "run_dummy_tests=true" >> "$GITHUB_OUTPUT" + echo "run_generators=true" >> "$GITHUB_OUTPUT" + echo "docs_only=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + BASE_REF="${{ github.event.pull_request.base.sha || github.event.before || 'origin/master' }}" script/ci-changes-detector "$BASE_REF" shell: bash diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 73e1628123..0b404fd1b1 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -27,22 +27,37 @@ jobs: run_ruby_tests: ${{ steps.detect.outputs.run_ruby_tests }} run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} + has_full_ci_label: ${{ steps.check-label.outputs.result }} steps: - uses: actions/checkout@v4 with: # Fetch enough history for change detection (50 commits is usually sufficient for PRs) fetch-depth: 50 persist-credentials: false + - name: Check for full-ci label + id: check-label + uses: ./.github/actions/check-full-ci-label - name: Detect relevant changes id: detect run: | + # If full-ci label is present, run everything + if [ "${{ steps.check-label.outputs.result }}" = "true" ]; then + echo "run_lint=true" >> "$GITHUB_OUTPUT" + echo "run_js_tests=true" >> "$GITHUB_OUTPUT" + echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT" + echo "run_dummy_tests=true" >> "$GITHUB_OUTPUT" + echo "run_generators=true" >> "$GITHUB_OUTPUT" + echo "docs_only=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + BASE_REF="${{ github.event.pull_request.base.sha || github.event.before || 'origin/master' }}" script/ci-changes-detector "$BASE_REF" shell: bash build: needs: detect-changes - # Run on master OR when JS tests needed on PR (but skip Node 20 on PR) + # Run on master OR when JS tests needed on PR if: | (github.ref == 'refs/heads/master' || needs.detect-changes.outputs.run_js_tests == 'true') strategy: @@ -50,8 +65,11 @@ jobs: include: # Always run: Latest Node version (fast feedback on PRs) - node-version: '22' - # Master only: Minimum supported Node version (full coverage) + # Master and full-ci label: Minimum supported Node version (full coverage) - node-version: '20' + exclude: + # Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label) + - node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pr-welcome-comment.yml b/.github/workflows/pr-welcome-comment.yml deleted file mode 100644 index ab5652f48b..0000000000 --- a/.github/workflows/pr-welcome-comment.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: PR Welcome Comment - -on: - pull_request: - types: [opened] - -jobs: - welcome: - # Skip for bots (dependabot, renovate, etc.) - if: github.event.pull_request.user.type != 'Bot' - runs-on: ubuntu-22.04 - permissions: - pull-requests: write - steps: - - name: Add welcome comment with CI command info - uses: peter-evans/create-or-update-comment@v4 - with: - issue-number: ${{ github.event.pull_request.number }} - body: | - 👋 Thanks for opening this PR! - - ### 🚀 Running Full CI Suite - - By default, PRs run a subset of CI jobs for faster feedback (latest Ruby/Node versions only). - - To run the **complete CI suite** including all dependency combinations and skipped jobs, comment: - - ``` - /run-skipped-ci - ``` - - This will trigger: - - ✅ Minimum supported versions (Ruby 3.2, Node 20) - - ✅ All example app tests - - ✅ Pro package integration tests - - ✅ All test matrices - - The full CI suite takes longer but ensures compatibility across all supported versions before merging. diff --git a/.github/workflows/pr-welcome-message.yml b/.github/workflows/pr-welcome-message.yml deleted file mode 100644 index 4d00fca5cb..0000000000 --- a/.github/workflows/pr-welcome-message.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: PR Welcome Message - -on: - pull_request: - types: [opened] - -jobs: - welcome: - runs-on: ubuntu-22.04 - permissions: - issues: write - pull-requests: write - steps: - - name: Post welcome message - uses: actions/github-script@v7 - with: - script: | - const welcomeMessage = [ - '👋 **Thanks for your contribution!**', - '', - 'This PR will run CI tests based on the files you changed. If some tests are skipped and you want to run the full test suite (including minimum dependency tests), you can use these commands:', - '', - '### CI Control Commands', - '', - '- **`/run-skipped-ci`** - Runs all skipped CI checks and enables full CI mode for this PR', - ' - Adds the `full-ci` label to ensure future commits also run the full test suite', - ' - Useful when you want comprehensive testing across all configurations', - '', - '- **`/stop-run-skipped-ci`** - Disables full CI mode and returns to standard CI', - ' - Removes the `full-ci` label', - ' - Future commits will only run tests for changed files', - '', - '**Note:**', - '- These commands require write access to the repository', - '- The `full-ci` label is preserved on merged PRs as a historical record', - '', - 'View CI progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).' - ].join('\n'); - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: welcomeMessage - }); - - console.log('✅ Posted welcome message to PR'); diff --git a/.github/workflows/rspec-package-specs.yml b/.github/workflows/rspec-package-specs.yml index cb1c062661..af91bb3ba9 100644 --- a/.github/workflows/rspec-package-specs.yml +++ b/.github/workflows/rspec-package-specs.yml @@ -27,22 +27,37 @@ jobs: run_ruby_tests: ${{ steps.detect.outputs.run_ruby_tests }} run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} + has_full_ci_label: ${{ steps.check-label.outputs.result }} steps: - uses: actions/checkout@v4 with: # Fetch enough history for change detection (50 commits is usually sufficient for PRs) fetch-depth: 50 persist-credentials: false + - name: Check for full-ci label + id: check-label + uses: ./.github/actions/check-full-ci-label - name: Detect relevant changes id: detect run: | + # If full-ci label is present, run everything + if [ "${{ steps.check-label.outputs.result }}" = "true" ]; then + echo "run_lint=true" >> "$GITHUB_OUTPUT" + echo "run_js_tests=true" >> "$GITHUB_OUTPUT" + echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT" + echo "run_dummy_tests=true" >> "$GITHUB_OUTPUT" + echo "run_generators=true" >> "$GITHUB_OUTPUT" + echo "docs_only=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + BASE_REF="${{ github.event.pull_request.base.sha || github.event.before || 'origin/master' }}" script/ci-changes-detector "$BASE_REF" shell: bash rspec-package-tests: needs: detect-changes - # Run on master OR when Ruby tests needed on PR (but skip minimum deps on PR) + # Run on master OR when Ruby tests needed on PR if: | (github.ref == 'refs/heads/master' || needs.detect-changes.outputs.run_ruby_tests == 'true') strategy: @@ -52,9 +67,13 @@ jobs: # Always run: Latest versions (fast feedback on PRs) - ruby-version: '3.4' dependency-level: 'latest' - # Master only: Minimum supported versions (full coverage) + # Master and full-ci label: Minimum supported versions (full coverage) - ruby-version: '3.2' dependency-level: 'minimum' + exclude: + # Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label) + - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} + dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} env: BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 diff --git a/.github/workflows/run-skipped-ci.yml b/.github/workflows/run-skipped-ci.yml index 688c62f111..a23427a1c5 100644 --- a/.github/workflows/run-skipped-ci.yml +++ b/.github/workflows/run-skipped-ci.yml @@ -207,13 +207,10 @@ jobs: status = '✅ **Successfully triggered skipped CI checks**'; } - // List the skipped checks we found - const skippedChecksList = skippedChecks.length > 0 - ? `\n**Skipped checks detected:**\n${skippedChecks.map(c => `- ${c.name} (${c.workflow_name})`).join('\n')}` - : ''; - - const verifiedList = verified.length > 0 ? `\n**Triggered workflows:**\n${verified.map(w => `- ✅ ${w.name}`).join('\n')}` : ''; - const notFoundList = notFound.length > 0 ? `\n\n**Triggered but not yet queued (may still start):**\n${notFound.map(w => `- ⏳ ${w.name}`).join('\n')}` : ''; + // Don't list individual checks - keep it simple + const skippedChecksList = ''; + const verifiedList = ''; + const notFoundList = ''; const failedList = failed.length > 0 ? `\n\n**Failed to trigger:**\n${failed.map(f => `- ❌ ${f.workflow}: ${f.error}`).join('\n')}` : ''; // Add full-ci label only if we actually triggered workflows or if checks are already running