ci(scripts): add reusable Pester testing workflow and PR validation integration#204
Merged
WilliamBerryiii merged 4 commits intomainfrom Jan 17, 2026
Merged
ci(scripts): add reusable Pester testing workflow and PR validation integration#204WilliamBerryiii merged 4 commits intomainfrom
WilliamBerryiii merged 4 commits intomainfrom
Conversation
cee34c5 to
03269a7
Compare
- add pester-tests.yml with workflow_call trigger - support soft-fail and changed-files-only inputs - install Pester 5.x and run tests with CI configuration - upload NUnit XML results as artifact 🧪 - Generated by Copilot
402f490 to
61287f4
Compare
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a reusable GitHub Actions workflow for running Pester tests in CI/CD pipelines. The workflow follows established patterns from existing workflows like ps-script-analyzer.yml and includes security best practices such as SHA-pinned actions, minimal permissions, and credential protection.
Changes:
- Added pester-tests.yml workflow with configurable soft-fail and changed-files-only inputs
- Implements Pester 5.x testing with CI-optimized configuration
- Includes NUnit XML artifact upload with 30-day retention
- Add pester-tests job calling reusable pester-tests.yml workflow - Configure soft-fail: false to block PRs with failing tests - Configure changed-files-only: true for efficiency 🧪 - Generated by Copilot
- Add step to detect changed .ps1/.psm1 files via git diff - Map source files to corresponding .Tests.ps1 files by naming convention - Use Get-ChildItem with -Recurse for reliable test file discovery - Pass filtered test paths to pester.config.ps1 when enabled - Skip test execution and artifact upload when no matching tests exist 🔧 - Generated by Copilot
agreaves-ms
approved these changes
Jan 17, 2026
- pin Pester to RequiredVersion 5.6.1 for reproducible builds - change pester.config.ps1 TestPath param from [string] to [string[]] 🐛 - Generated by Copilot
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.
Pull Request
Description
Adds a reusable GitHub Actions workflow for running Pester tests across the repository and integrates it into the PR validation pipeline. This provides standardized PowerShell testing infrastructure that blocks PRs with failing tests.
Key features:
Reusable pester-tests.yml workflow:
workflow_calltrigger enables reuse from other workflows viauses: ./.github/workflows/pester-tests.ymlsoft-fail(default: false),changed-files-only(default: true)-CIconfiguration for CI-optimized outputPR validation integration:
pester-testsjob to pr-validation.ymlsoft-fail: falseto block PRs with failing testschanged-files-only: truefor efficiencySecurity:
persist-credentials: falseon checkoutcontents: readpermission scopeRelated Issue(s)
Closes #194
Closes #195
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
prompt-builderchatmode and addressed all feedback.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/chatmodes/*.chatmode.md)Other:
.ps1,.sh,.py)Testing
Checklist
Required Checks
AI Artifact Contributions
N/A - This PR does not include AI artifacts.
Required Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run lint:md-linksnpm run lint:psSecurity Considerations
Security notes:
persist-credentials: falseon checkout to prevent credential leakagecontents: readpermission scope at both workflow and job levelsactions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8(v4.2.2)actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f(v4.4.3)Additional Notes
This workflow builds on the Pester infrastructure established in #202 (pester.config.ps1, GitMocks.psm1). Future PRs will add actual test files that leverage this workflow.