1.0.10 features #25
Workflow file for this run
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
| 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 *On Linux*' | |
| - name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated | |
| id: publish-coverage | |
| run: | | |
| cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
| cat coveragereport/SummaryGithub.md >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Add comment to Pull Request | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `${{ steps.publish-coverage.outputs }}` | |
| }); | |
| 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 *On Windows*' | |
| - name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated | |
| id: publish-coverage | |
| run: | | |
| cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
| cat coveragereport/SummaryGithub.md >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Add comment to Pull Request | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `${{ steps.publish-coverage.outputs }}` | |
| }); | |
| 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 *On macOS*' | |
| - name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated | |
| id: publish-coverage | |
| run: | | |
| cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
| cat coveragereport/SummaryGithub.md >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Add comment to Pull Request | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `${{ steps.publish-coverage.outputs }}` | |
| }); |