Skip to content

Commit

Permalink
Checks the quality of PowerShell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandelagemaat committed Aug 13, 2021
1 parent a2211b6 commit 300d0aa
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,43 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Restore dependencies
run: dotnet restore Source/ISHRemote/ISHRemote.sln

- name: Build
run: dotnet build --no-restore --no-incremental --configuration release Source/ISHRemote/ISHRemote.sln

- name: Install PSScriptAnalyzer module
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -ErrorAction Stop
- name: Lint with PSScriptAnalyzer
shell: pwsh
run: |
Invoke-ScriptAnalyzer -Path . -Recurse -Outvariable issues
$errors = $issues.Where({$_.Severity -eq 'Error'})
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
if ($errors) {
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total."
} else {
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
}
$errors
$warnings
- name: Archive ISHRemote module
uses: actions/upload-artifact@v2
with:
Expand Down

0 comments on commit 300d0aa

Please sign in to comment.