Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 10 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ on:
- '**.md'
- 'docs/**'
workflow_dispatch:
inputs:
run_minimum_tests:
description: 'Run minimum dependency matrix (Ruby 3.2)'
required: false
type: boolean
default: false

jobs:
detect-changes:
Expand Down Expand Up @@ -52,9 +58,10 @@ jobs:
- ruby-version: '3.2'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '3.2' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && 'minimum' || '' }}
# When run_minimum_tests is true, skip latest (run only minimum)
- ${{ inputs.run_minimum_tests && fromJSON('{"ruby-version": "3.4", "dependency-level": "latest"}') || fromJSON('{}') }}
# When run_minimum_tests is false, skip minimum on regular PRs (run only on master/workflow_dispatch)
- ${{ !inputs.run_minimum_tests && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && fromJSON('{"ruby-version": "3.2", "dependency-level": "minimum"}') || fromJSON('{}') }}
env:
SKIP_YARN_COREPACK_CHECK: 0
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ on:
- '**.md'
- 'docs/**'
workflow_dispatch:
inputs:
run_minimum_tests:
description: 'Run minimum dependency matrix (Ruby 3.2, Node 20)'
required: false
type: boolean
default: false

jobs:
detect-changes:
Expand Down Expand Up @@ -53,10 +59,10 @@ jobs:
node-version: '20'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && 'minimum' || '' }}
# When run_minimum_tests is true, skip latest (run only minimum)
- ${{ inputs.run_minimum_tests && fromJSON('{"ruby-version": "3.4", "node-version": "22", "dependency-level": "latest"}') || fromJSON('{}') }}
# When run_minimum_tests is false, skip minimum on regular PRs (run only on master/workflow_dispatch)
- ${{ !inputs.run_minimum_tests && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && fromJSON('{"ruby-version": "3.2", "node-version": "20", "dependency-level": "minimum"}') || fromJSON('{}') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -143,10 +149,10 @@ jobs:
node-version: '20'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && 'minimum' || '' }}
# When run_minimum_tests is true, skip latest (run only minimum)
- ${{ inputs.run_minimum_tests && fromJSON('{"ruby-version": "3.4", "node-version": "22", "dependency-level": "latest"}') || fromJSON('{}') }}
# When run_minimum_tests is false, skip minimum on regular PRs (run only on master/workflow_dispatch)
- ${{ !inputs.run_minimum_tests && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && fromJSON('{"ruby-version": "3.2", "node-version": "20", "dependency-level": "minimum"}') || fromJSON('{}') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down
69 changes: 43 additions & 26 deletions .github/workflows/run-skipped-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,49 @@ jobs:
with:
script: |
const prData = ${{ steps.pr.outputs.result }};
const workflows = [
'main.yml',
'examples.yml',
'pro-integration-tests.yml',
'pro-package-tests.yml'

// Workflows that support minimum dependency testing
const workflowsWithMinimum = [
{ id: 'main.yml', name: 'Main Tests' },
{ id: 'examples.yml', name: 'Generator Tests' }
];

// Pro workflows always run (no minimum matrix)
const proWorkflows = [
{ id: 'pro-integration-tests.yml', name: 'Pro Integration Tests' },
{ id: 'pro-package-tests.yml', name: 'Pro Package Tests' }
];

const succeeded = [];
const failed = [];
const skipped = [];

// Trigger all workflows
for (const workflowId of workflows) {
// Trigger workflows with minimum dependency testing
for (const workflow of workflowsWithMinimum) {
try {
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: workflowId,
ref: prData.ref
workflow_id: workflow.id,
ref: prData.ref,
inputs: {
run_minimum_tests: 'true'
}
});
console.log(`✅ Triggered ${workflowId}`);
succeeded.push(workflowId);
console.log(`✅ Triggered ${workflow.id} with run_minimum_tests=true`);
succeeded.push(workflow);
} catch (error) {
console.error(`❌ Failed to trigger ${workflowId}:`, error.message);
failed.push({ workflow: workflowId, error: error.message });
console.error(`❌ Failed to trigger ${workflow.id}:`, error.message);
failed.push({ workflow: workflow.name, error: error.message });
}
}

// Skip Pro workflows (they don't have minimum matrix, always run on PRs if needed)
for (const workflow of proWorkflows) {
console.log(`⏭️ Skipping ${workflow.id} (no minimum dependency matrix)`);
skipped.push(workflow);
}

// Wait a bit for workflows to queue
if (succeeded.length > 0) {
console.log('Waiting 5 seconds for workflows to queue...');
Expand All @@ -132,23 +148,23 @@ jobs:
created: `>${new Date(Date.now() - 60000).toISOString()}`
});

for (const workflowId of succeeded) {
for (const workflow of succeeded) {
const found = runs.data.workflow_runs.some(run =>
run.path === `.github/workflows/${workflowId}` &&
run.path === `.github/workflows/${workflow.id}` &&
run.head_sha === prData.sha &&
run.event === 'workflow_dispatch'
);

if (found) {
verified.push(workflowId);
verified.push(workflow);
} else {
notFound.push(workflowId);
notFound.push(workflow);
}
}
}

// Build the comment body based on actual results
let status = '✅ **Successfully triggered and verified all workflows**';
let status = '✅ **Successfully triggered skipped CI tests**';
if (failed.length > 0 && notFound.length > 0) {
status = '❌ **Failed to trigger or verify workflows**';
} else if (failed.length > 0) {
Expand All @@ -157,21 +173,22 @@ jobs:
status = '⚠️ **Workflows triggered but not yet verified**';
}

const verifiedList = verified.length > 0 ? verified.map(w => `- ✅ ${w}`).join('\n') : '';
const notFoundList = notFound.length > 0 ? `\n\n**Triggered but not yet queued (may still start):**\n${notFound.map(w => `- ⏳ ${w}`).join('\n')}` : '';
const verifiedList = verified.length > 0 ? 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')}` : '';
const failedList = failed.length > 0 ? `\n\n**Failed to trigger:**\n${failed.map(f => `- ❌ ${f.workflow}: ${f.error}`).join('\n')}` : '';
const skippedList = skipped.length > 0 ? `\n\n**Skipped (already run on PRs):**\n${skipped.map(w => `- ⏭️ ${w.name}`).join('\n')}` : '';

const body = `🚀 **Full CI Suite Results**
const body = `🚀 **Skipped CI Tests Triggered**

${status}

${verifiedList ? `**Verified workflows:**\n${verifiedList}` : ''}${notFoundList}${failedList}
${verifiedList ? `**Running minimum dependency tests:**\n${verifiedList}` : ''}${notFoundList}${failedList}${skippedList}

${verified.length > 0 ? `\nThese will run all CI jobs including those normally skipped on PRs:
${verified.length > 0 ? `\n**What's running:**
- ✅ Minimum dependency versions (Ruby 3.2, Node 20)
- ✅ All example app tests
- ✅ Pro package integration tests
- ✅ Pro package unit tests
- ✅ Generator tests with minimum dependencies

**Note:** Pro package tests and latest dependency tests are skipped because they already run on all PRs.

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

Expand Down
Loading