Skip to content

Commit

Permalink
feat: Support skip_testing input to explicitly skip target testing
Browse files Browse the repository at this point in the history
Reference: https://linear.app/speakeasy/issue/GEN-780/feature-sdk-generation-action-skip-target-testing-input

Set to true to explicitly skip Speakeasy workflow target testing after generation, even when enabled in the Speakeasy workflow configuration. This is useful for running workflow testing as a separate GitHub Actions workflow without affecting/blocking generation. It can also be used to workaround potential testing bugs where the generation should still be preserved.
  • Loading branch information
bflad committed Dec 5, 2024
1 parent 16e5fb5 commit 84df2e2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/workflow-executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ on:
description: "Version of pnpm to install. Not recommended for use without consulting Speakeasy support."
required: false
type: string
skip_testing:
description: "Set to true to explicitly skip Speakeasy workflow target testing after generation, even when enabled in the Speakeasy workflow configuration. This is useful for running workflow testing as a separate GitHub Actions workflow without affecting/blocking generation."
default: false
required: false
type: boolean
secrets:
github_access_token:
description: A GitHub access token with write access to the repo
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ inputs:
pnpm_version:
description: "Version of pnpm to install. Not recommended for use without consulting Speakeasy support."
required: false
skip_testing:
description: "Set to true to explicitly skip Speakeasy workflow target testing after generation, even when enabled in the Speakeasy workflow configuration. This is useful for running workflow testing as a separate GitHub Actions workflow without affecting/blocking generation."
default: "false"
required: false
outputs:
publish_python:
description: "Whether the Python SDK will be published to PyPi"
Expand Down
4 changes: 4 additions & 0 deletions internal/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func Run(sourcesOnly bool, installationURLs map[string]string, repoURL string, r
args = append(args, "--set-version", environment.SetVersion())
}

if environment.SkipTesting() {
args = append(args, "--skip-testing")
}

if environment.ForceGeneration() {
fmt.Println("\nforce input enabled - setting SPEAKEASY_FORCE_GENERATION=true")
os.Setenv("SPEAKEASY_FORCE_GENERATION", "true")
Expand Down
5 changes: 5 additions & 0 deletions internal/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func RegistryTags() string {
return os.Getenv("INPUT_REGISTRY_TAGS")
}

// Enabled if the INPUT_SKIP_TESTING environment variable is set to "true".
func SkipTesting() bool {
return os.Getenv("INPUT_SKIP_TESTING") == "true"
}

func SpecifiedTarget() string {
return os.Getenv("INPUT_TARGET")
}
Expand Down

0 comments on commit 84df2e2

Please sign in to comment.