File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ workflow_dispatch :
5+ pull_request :
6+
7+ jobs :
8+ Testing :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v2
12+ - name : Install PSScriptAnalyzer module
13+ shell : pwsh
14+ run : |
15+ Set-PSRepository PSGallery -InstallationPolicy Trusted
16+ Install-Module PSScriptAnalyzer -ErrorAction Stop
17+ - name : Lint with PSScriptAnalyzer
18+ shell : pwsh
19+ run : |
20+ Invoke-ScriptAnalyzer -Path . -Recurse -Outvariable issues
21+ $issues | ConvertTo-Json -Depth 2 | Set-Content -Path '${{ github.workspace }}/pssa.json'
22+ $errors = $issues.Where({$_.Severity -eq 'Error'})
23+ $warnings = $issues.Where({$_.Severity -eq 'Warning'})
24+ if ($errors) {
25+ Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
26+ } else {
27+ Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
28+ }
29+ - name : Upload test results
30+ uses : actions/upload-artifact@v2
31+ with :
32+ name : pssa-results
33+ path : ${{ github.workspace }}/pssa.json
34+ # - name: Test with Pester
35+ # shell: pwsh
36+ # run: Invoke-Pester Unit.Tests.ps1 -Passthru | Export-CliXml -Path Unit.Tests.xml
You can’t perform that action at this time.
0 commit comments