Skip to content

Commit 338da00

Browse files
committed
Remove duplication from Pester workflow
1 parent d95f10b commit 338da00

File tree

1 file changed

+4
-35
lines changed

1 file changed

+4
-35
lines changed

.github/workflows/Pester.yml

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -67,49 +67,18 @@ jobs:
6767
path: testResults.xml
6868

6969
- name: Upload code coverage
70-
if: always()
70+
if: always() && matrix.os == 'windows-latest' && matrix.psversion == 'pwsh'
7171
uses: actions/upload-artifact@v4
7272
with:
73-
name: code-coverage-${{ matrix.os }}-${{ matrix.psversion }}
73+
name: code-coverage
7474
path: coverage.xml
7575

7676
- name: Upload coverage reports to Codecov
77-
if: always()
77+
if: always() && matrix.os == 'windows-latest' && matrix.psversion == 'pwsh'
7878
uses: codecov/codecov-action@v5
7979
with:
8080
token: ${{ secrets.CODECOV_TOKEN }}
8181
slug: AsBuiltReport/AsBuiltReport.Core
8282
files: ./coverage.xml
83-
flags: unittests-${{ matrix.os }}-${{ matrix.psversion }}
83+
flags: unittests
8484
fail_ci_if_error: false
85-
86-
analyze:
87-
runs-on: windows-latest
88-
89-
steps:
90-
- name: Checkout code
91-
uses: actions/checkout@v4
92-
93-
- name: Install PSScriptAnalyzer
94-
shell: pwsh
95-
run: |
96-
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
97-
Install-Module -Name PSScriptAnalyzer -Force
98-
99-
- name: Run PSScriptAnalyzer
100-
shell: pwsh
101-
run: |
102-
$SettingsPath = './.github/workflows/PSScriptAnalyzerSettings.psd1'
103-
if (Test-Path $SettingsPath) {
104-
$Results = Invoke-ScriptAnalyzer -Path ./AsBuiltReport.Core -Recurse -Settings $SettingsPath
105-
} else {
106-
$Results = Invoke-ScriptAnalyzer -Path ./AsBuiltReport.Core -Recurse
107-
}
108-
109-
if ($Results) {
110-
$Results | Format-Table -AutoSize
111-
$Errors = $Results | Where-Object Severity -eq 'Error'
112-
if ($Errors.Count -gt 0) {
113-
exit 1
114-
}
115-
}

0 commit comments

Comments
 (0)