-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.33 KB
/
ci.yml
File metadata and controls
36 lines (34 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: CI
on:
push:
pull_request:
schedule:
- cron: "0 10 * * 1" # At 10:00 on Monday.
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint with PSScriptAnalyzer
uses: Amadevus/pwsh-script@v2
with:
script: |
$null = Install-Module -Name PSScriptAnalyzer -Force -SkipPublisherCheck -MinimumVersion '1.19'
$issues = Invoke-ScriptAnalyzer -Path .
foreach ($msg in ($issues | Where-Object Severity -EQ 'Error')) {
Write-ActionError "$($msg.RuleName): $($msg.Message)" -File $msg.ScriptPath -Line $msg.Line -Column $msg.Column
}
foreach ($msg in ($issues | Where-Object Severity -EQ 'Warning')) {
Write-ActionWarning "$($msg.RuleName): $($msg.Message)" -File $msg.ScriptPath -Line $msg.Line -Column $msg.Column
}
foreach ($msg in ($issues | Where-Object Severity -EQ 'Information')) {
Write-ActionInfo "$($msg.ScriptPath):$($msg.Line):$($msg.Column):$($msg.RuleName): $($msg.Message)"
}
- name: Test with Pester
run: |
$null = Install-Module -Name Pester -Force -SkipPublisherCheck -MinimumVersion '5.0'
Import-Module Pester -MinimumVersion '5.0'
Invoke-Pester -CI