Skip to content

Updated powershell provider to be in parity with the other modules that use the new structure #32

Updated powershell provider to be in parity with the other modules that use the new structure

Updated powershell provider to be in parity with the other modules that use the new structure #32

Workflow file for this run

name: Run Pester Tests
on:
pull_request:
branches:
- develop
- main
workflow_dispatch:
jobs:
pester-test-linux:
name: Pester test (On Linux)
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Execute runTests.ps1
shell: pwsh
run: |
.\runTests.ps1
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: (!cancelled())
with:
check_name: Pester test (On Linux) Results
files: testResults.xml
- name: Setup .NET Core # Required to execute ReportGenerator
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: 'ga'
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.4.13
with:
reports: 'coverage.xml'
targetdir: 'coveragereport'
reporttypes: 'MarkdownSummaryGithub'
title: 'Pester Test Coverage Report'
- name: Add comment to PR # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated
if: github.event_name == 'pull_request'
run: gh pr comment $PR_NUMBER --edit-last --create-if-none --body-file coveragereport/SummaryGithub.md # Adjust path and filename if necessary
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
- name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated
run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY # Adjust path and filename if necessary
shell: bash
pester-test-windows:
name: Pester test (On Windows)
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Execute runTests.ps1
shell: pwsh
run: |
.\runTests.ps1
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: (!cancelled())
with:
check_name: Pester test (On Windows) Results
files: testResults.xml
- name: Setup .NET Core # Required to execute ReportGenerator
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: 'ga'
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.4.13
with:
reports: 'coverage.xml'
targetdir: 'coveragereport'
reporttypes: 'MarkdownSummaryGithub'
title: 'Pester Test Coverage Report (Windows)'
- name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated
run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY # Adjust path and filename if necessary
shell: bash
pester-test-macos:
name: Pester test (On macOS)
runs-on: macos-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- name: Checkout Repository Code
uses: actions/checkout@v4
- name: Execute runTests.ps1 with Pester
shell: pwsh
run: |
.\runTests.ps1
- name: Publish Pester Test Results
uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: (!cancelled())
with:
check_name: Pester test (On macOS) Results
files: testResults.xml
- name: Setup .NET Core # Required to execute ReportGenerator
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: 'ga'
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.4.13
with:
reports: 'coverage.xml'
targetdir: 'coveragereport'
reporttypes: 'MarkdownSummaryGithub'
title: 'Pester Test Coverage Report (macOS)'
- name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated
run: cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY # Adjust path and filename if necessary
shell: bash