-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
enhancementNew feature or requestNew feature or requestgithub-actionsGitHub Actions workflowsGitHub Actions workflowsworkflowsGitHub Actions workflowsGitHub Actions workflows
Description
Summary
Integrate the Pester testing workflow into the PR validation process so tests run automatically on pull requests that modify PowerShell files.
Parent Issue: #190
Requirements
- Update
.github/workflows/ci.yml(or create dedicated PR workflow) - Call the reusable
pester-tests.ymlworkflow - Use
changed-files-only: truefor efficient PR validation - Use
soft-fail: falseto block PRs with failing tests - Configure path filtering for
**/*.ps1and**/*.psm1
Implementation Details
Integration Pattern
jobs:
pester-tests:
name: PowerShell Tests
uses: ./.github/workflows/pester-tests.yml
with:
soft-fail: false
changed-files-only: true
if: |
github.event_name == 'pull_request' &&
(contains(github.event.pull_request.changed_files, '.ps1') ||
contains(github.event.pull_request.changed_files, '.psm1'))Alternative: Path Filter Job
jobs:
changes:
runs-on: ubuntu-latest
outputs:
powershell: ${{ steps.filter.outputs.powershell }}
steps:
- uses: dorny/paths-filter@... # SHA-pinned
id: filter
with:
filters: |
powershell:
- '**/*.ps1'
- '**/*.psm1'
- 'scripts/tests/**'
pester-tests:
needs: changes
if: needs.changes.outputs.powershell == 'true'
uses: ./.github/workflows/pester-tests.ymlAcceptance Criteria
- PR workflow calls pester-tests.yml for PowerShell changes
- Tests block PR merge on failure (soft-fail: false)
- Only runs when
.ps1or.psm1files change - Check appears in PR status checks
- Works with existing CI workflow structure
Dependencies
- [Issue]: Add reusable Pester testing GitHub Actions workflow #194 (reusable workflow) must be complete
Estimated Effort
30 minutes - 1 hour
Additional Context
Reference Files
.github/workflows/ci.yml- Existing CI workflow to integrate with.github/workflows/ps-script-analyzer.yml- Example of reusable workflow integration
Related Issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgithub-actionsGitHub Actions workflowsGitHub Actions workflowsworkflowsGitHub Actions workflowsGitHub Actions workflows