Skip to content

ci(scripts): add reusable Pester testing workflow and PR validation integration#204

Merged
WilliamBerryiii merged 4 commits intomainfrom
feat/194-pester-workflow
Jan 17, 2026
Merged

ci(scripts): add reusable Pester testing workflow and PR validation integration#204
WilliamBerryiii merged 4 commits intomainfrom
feat/194-pester-workflow

Conversation

@WilliamBerryiii
Copy link
Copy Markdown
Member

@WilliamBerryiii WilliamBerryiii commented Jan 17, 2026

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_call trigger enables reuse from other workflows via uses: ./.github/workflows/pester-tests.yml
    • Configurable inputs: soft-fail (default: false), changed-files-only (default: true)
    • Pester 5.x with -CI configuration for CI-optimized output
    • Artifact upload persists NUnit XML results for 30 days
  • PR validation integration:

    • Adds pester-tests job to pr-validation.yml
    • Configured with soft-fail: false to block PRs with failing tests
    • Uses changed-files-only: true for efficiency
  • Security:

    • All GitHub Actions are SHA-pinned to prevent supply chain attacks
    • Uses persist-credentials: false on checkout
    • Minimal contents: read permission scope

Related Issue(s)

Closes #194
Closes #195

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder chatmode and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot chatmode (.github/chatmodes/*.chatmode.md)

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Testing

  • Validated YAML syntax
  • Confirmed workflow structure matches existing patterns (ps-script-analyzer.yml)
  • Verified SHA pins match approved versions in tool-checksums.json

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)

AI Artifact Contributions

N/A - This PR does not include AI artifacts.

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues
  • Security-related scripts follow the principle of least privilege

Security notes:

  • Uses persist-credentials: false on checkout to prevent credential leakage
  • Minimal contents: read permission scope at both workflow and job levels
  • All GitHub Actions are SHA-pinned to prevent supply chain attacks:
    • actions/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.

@WilliamBerryiii WilliamBerryiii requested a review from a team as a code owner January 17, 2026 00:56
@WilliamBerryiii WilliamBerryiii force-pushed the feat/193-pester-infrastructure branch from cee34c5 to 03269a7 Compare January 17, 2026 01:14
Base automatically changed from feat/193-pester-infrastructure to main January 17, 2026 01:26
- 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
@WilliamBerryiii WilliamBerryiii force-pushed the feat/194-pester-workflow branch from 402f490 to 61287f4 Compare January 17, 2026 01:31
Copilot AI review requested due to automatic review settings January 17, 2026 01:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 17, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 8e8c483db84b4bee98b60c0593521ed34d9990e8 🟢 6.7
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Maintained🟢 79 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Packaging⚠️ -1packaging workflow not detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Security-Policy🟢 9security policy file detected
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Vulnerabilities🟢 91 existing vulnerabilities detected
SAST🟢 8SAST tool detected but not run on all commits
actions/actions/upload-artifact b7c566a772e6b6bfb58ed0dc250532a479d7789f 🟢 6.5
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review🟢 10all changesets reviewed
Packaging⚠️ -1packaging workflow not detected
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 1dependency not pinned by hash detected -- score normalized to 1
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST🟢 9SAST tool detected but not run on all commits

Scanned Files

  • .github/workflows/pester-tests.yml

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@WilliamBerryiii WilliamBerryiii changed the title ci(scripts): add reusable Pester testing workflow ci(scripts): add reusable Pester testing workflow and PR validation integration Jan 17, 2026
- 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
Copilot AI review requested due to automatic review settings January 17, 2026 02:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

- pin Pester to RequiredVersion 5.6.1 for reproducible builds
- change pester.config.ps1 TestPath param from [string] to [string[]]

🐛 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii merged commit a13f944 into main Jan 17, 2026
15 checks passed
@WilliamBerryiii WilliamBerryiii deleted the feat/194-pester-workflow branch January 17, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue]: Integrate Pester tests into PR validation workflow [Issue]: Add reusable Pester testing GitHub Actions workflow

3 participants