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
28 changes: 28 additions & 0 deletions .github/workflows/generate-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,36 @@ concurrency:
cancel-in-progress: true

jobs:
check-paths:
name: Check Generation Paths
if: ${{ inputs.dry_run }}
runs-on: ubuntu-latest
outputs:
should_run: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.generation == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Filter changed paths
uses: dorny/paths-filter@v4
id: filter
with:
filters: |
generation:
- '.speakeasy/**'
- '.genignore'
- '.github/speakeasy/**'
- '.github/workflows/generate-command.yml'
- 'gen.yaml'
- 'overlays/**'
- 'README.md'
- 'scripts/**'
- 'poe_tasks.toml'
- 'src/**'

generate:
name: Generate SDK
needs: [check-paths]
if: ${{ always() && (!inputs.dry_run || needs.check-paths.outputs.should_run == 'true') }}
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
Expand Down
33 changes: 5 additions & 28 deletions .github/workflows/test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
# and that the committed generated code matches what the generation pipeline produces.
#
# Jobs:
# 1. validate: Runs the full generation pipeline in dry-run mode
# 1. validate: Calls generate-command.yml with dry_run=true. The generation
# workflow handles its own path filtering — it skips the Generate SDK job
# when only non-generation files changed (e.g., dev dependency bumps).
# 2. zero-diff: Checks for drift using the validate job's outputs (in-place git status).
# If drift is detected, the check fails and posts a comment telling the author to run /generate.
#
# This workflow calls the main generation workflow with dry_run=true to ensure
# both workflows use the same generation logic.
#
# Note: paths-ignore is NOT used at the workflow level because GitHub treats a
# workflow that never runs as "expected" (pending), which blocks required checks.
# Instead, we filter paths at the job level so skipped jobs report as "skipped"
# (equivalent to "passed" for required checks).

name: Test (Full)

Expand All @@ -27,37 +24,17 @@ permissions:
pull-requests: write

jobs:
check-paths:
name: Check Changed Paths
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Filter changed paths
uses: dorny/paths-filter@v4
id: filter
with:
filters: |
generation:
- '**'
- '!README.md'
- '!docs/**'
outputs:
should_run: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.generation == 'true' }}

validate:
name: Validate Generation (Dry Run)
needs: check-paths
if: needs.check-paths.outputs.should_run == 'true'
uses: ./.github/workflows/generate-command.yml
with:
dry_run: true
secrets: inherit

zero-diff:
name: Zero-Diff Check (Generated Code)
needs: [check-paths, validate]
if: needs.check-paths.outputs.should_run == 'true' && github.event_name == 'pull_request'
needs: [validate]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
Loading