Skip pr.yaml test stages when ./tests directory is missing#138
Merged
Chris-Wolfgang merged 1 commit intomainfrom Apr 25, 2026
Merged
Skip pr.yaml test stages when ./tests directory is missing#138Chris-Wolfgang merged 1 commit intomainfrom
Chris-Wolfgang merged 1 commit intomainfrom
Conversation
Brings the workflow in line with scripts/build-pr.ps1, which already skips test execution when there are no test projects. Template repos like this one have no tests by design, but still benefit from the build, security, and gitleaks stages. Changes: - Stage 1 (Linux), Stage 2 (Windows), Stage 3 (macOS) test steps now exit 0 with an informational message when ./tests is absent or empty. - Stage 3 coverage threshold step skips instead of failing when no Summary.txt was generated (the prior step already handles missing coverage internally). Build, security scan, and gitleaks jobs still run on every PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
exit 1when./testsis absent. This template repo has no tests by design, so every PR (including Bump Meziantou.Analyzer from 3.0.48 to 3.0.52 #134, Bump Microsoft.Extensions.Hosting from 10.0.6 to 10.0.7 #135, Bump SonarAnalyzer.CSharp from 10.23.0.137933 to 10.24.0.138807 #136, Bump System.Configuration.ConfigurationManager from 10.0.5 to 10.0.7 #137 from dependabot) fails on the test step even when build + security pass.scripts/build-pr.ps1, which already skips test execution gracefully (No test projects found in ./tests — skipping).Changes
./testsdoesn't exist or contains no test projects.-ErrorAction SilentlyContinuetoGet-ChildItem.exit 1) whenSummary.txtwasn't generated.release.yamlandscripts/build-pr.ps1did not need updates (release.yaml doesn't reference./tests; build-pr.ps1 already had this behavior).Test plan
pwsh ./scripts/build-pr.ps1 -SkipSecurity -SkipCoveragesucceeds locally and reportsNo test projects found in ./tests - skipping→All checks passed🤖 Generated with Claude Code