Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/actions/check-full-ci-label/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check for full-ci label
description: Checks if the PR has the full-ci label to enable full CI mode
outputs:
result:
description: 'Whether the full-ci label is present (string: "true" or "false")'
value: ${{ steps.check.outputs.result }}
runs:
using: composite
steps:
- name: Check for full-ci label
id: check
uses: actions/github-script@v7
with:
result-encoding: string
script: |
// Only check labels on pull requests
if (!context.payload.pull_request) {
return 'false';
}

const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number
});

const hasLabel = labels.some(label => label.name === 'full-ci');
console.log(`full-ci label present: ${hasLabel}`);
return hasLabel ? 'true' : 'false';
14 changes: 9 additions & 5 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@ 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 force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ 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"
Expand Down Expand Up @@ -69,9 +73,9 @@ jobs:
- ruby-version: '3.2'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '3.2' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && 'minimum' || '' }}
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
env:
SKIP_YARN_COREPACK_CHECK: 0
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@ 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 force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ 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"
Expand Down Expand Up @@ -70,10 +74,10 @@ jobs:
node-version: '20'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && 'minimum' || '' }}
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -160,10 +164,10 @@ jobs:
node-version: '20'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && 'minimum' || '' }}
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/pr-welcome-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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');
8 changes: 6 additions & 2 deletions .github/workflows/pro-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ jobs:
docs_only: ${{ steps.detect.outputs.docs_only }}
run_pro_lint: ${{ steps.detect.outputs.run_pro_lint }}
run_pro_tests: ${{ steps.detect.outputs.run_pro_tests }}
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
working-directory: .
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_pro_lint=true" >> "$GITHUB_OUTPUT"
echo "run_pro_tests=true" >> "$GITHUB_OUTPUT"
echo "docs_only=false" >> "$GITHUB_OUTPUT"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pro-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ jobs:
docs_only: ${{ steps.detect.outputs.docs_only }}
run_pro_lint: ${{ steps.detect.outputs.run_pro_lint }}
run_pro_tests: ${{ steps.detect.outputs.run_pro_tests }}
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
working-directory: .
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_pro_lint=true" >> "$GITHUB_OUTPUT"
echo "run_pro_tests=true" >> "$GITHUB_OUTPUT"
echo "docs_only=false" >> "$GITHUB_OUTPUT"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pro-package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ jobs:
docs_only: ${{ steps.detect.outputs.docs_only }}
run_pro_lint: ${{ steps.detect.outputs.run_pro_lint }}
run_pro_tests: ${{ steps.detect.outputs.run_pro_tests }}
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
working-directory: .
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_pro_lint=true" >> "$GITHUB_OUTPUT"
echo "run_pro_tests=true" >> "$GITHUB_OUTPUT"
echo "docs_only=false" >> "$GITHUB_OUTPUT"
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/run-skipped-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,34 @@ jobs:
const notFoundList = notFound.length > 0 ? `\n\n**Triggered but not yet queued (may still start):**\n${notFound.map(w => `- ⏳ ${w.name}`).join('\n')}` : '';
const failedList = failed.length > 0 ? `\n\n**Failed to trigger:**\n${failed.map(f => `- ❌ ${f.workflow}: ${f.error}`).join('\n')}` : '';

const body = `🚀 **Skipped CI Checks - Trigger Results**
// Add full-ci label only if we actually triggered workflows or if checks are already running
let labelAdded = false;
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['full-ci']
});
labelAdded = true;
console.log('✅ Added full-ci label to PR');
} catch (error) {
console.error('⚠️ Failed to add label:', error.message);
}

const body = `🚀 **Full CI Mode Enabled**

${status}
${skippedChecksList}
${verifiedList}${notFoundList}${failedList}

${verified.length > 0 ? `\n**Note:** These workflows will run with \`force_run: true\` to bypass detect-changes logic that caused them to skip.
${labelAdded && verified.length > 0 ? `\n**Note:** Added the \`full-ci\` label to this PR. All future commits will run the full CI suite (including minimum dependency tests) until the label is removed.

To disable full CI mode, use the \`/stop-run-skipped-ci\` command.

View progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).` : ''}

${notApplicable.length > 0 ? `\nAll CI checks are already running on this PR. Use this command when you see skipped checks that you want to run.` : ''}`;
${labelAdded && notApplicable.length > 0 ? `\nAll CI checks are already running on this PR. Added the \`full-ci\` label - future commits will run the full CI suite.` : ''}`;

// Post the comment
await github.rest.issues.createComment({
Expand Down
Loading