File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed
Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 2525 r-version : ['3.6.3', '4.1.1']
2626
2727 steps :
28- - uses : actions/checkout@v4
28+ - uses : actions/checkout@v5
2929 - name : Set up R ${{ matrix.r-version }}
3030 uses : r-lib/actions/setup-r@f57f1301a053485946083d7a45022b278929a78a
3131 with :
3838 - name : Check
3939 run : rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
4040 shell : Rscript {0}
41+
42+ lint-with-PSScriptAnalyzer :
43+ name : Install and run PSScriptAnalyzer
44+ runs-on : ubuntu-latest
45+ steps :
46+ - uses : actions/checkout@v5
47+ - name : Install PSScriptAnalyzer module
48+ shell : pwsh
49+ run : |
50+ Set-PSRepository PSGallery -InstallationPolicy Trusted
51+ Install-Module PSScriptAnalyzer -ErrorAction Stop
52+ - name : Lint with PSScriptAnalyzer
53+ shell : pwsh
54+ run : |
55+ Invoke-ScriptAnalyzer -Path *.ps1 -Recurse -Outvariable issues
56+ $errors = $issues.Where({$_.Severity -eq 'Error'})
57+ $warnings = $issues.Where({$_.Severity -eq 'Warning'})
58+ if ($errors) {
59+ Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop
60+ } else {
61+ Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
62+ }
63+
64+ jobs:
65+ install-dependencies :
66+ name : Install dependencies
67+ runs-on : ubuntu-latest
68+ steps :
69+ - uses : actions/checkout@v5
70+ - name : Install from PSGallery
71+ shell : pwsh
72+ run : |
73+ Set-PSRepository PSGallery -InstallationPolicy Trusted
74+ Install-Module SqlServer, PSScriptAnalyzer
You can’t perform that action at this time.
0 commit comments