-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (52 loc) · 1.75 KB
/
test.yml
File metadata and controls
60 lines (52 loc) · 1.75 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Run salt tests
on:
pull_request:
concurrency:
group: test-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
windows:
uses: plus3it/actions-workflows/.github/workflows/test-salt-windows.yml@00ff10246f901f01818db412fa99124dbed4a00c
strategy:
matrix:
os_version:
- windows-2019
- windows-2022
- windows-2025
salt_state:
- notepad-plusplus
salt_pillar_root:
- ./tests/pillar/test-main
with:
salt-os-version: ${{ matrix.os_version }}
salt-state: ${{ matrix.salt_state }}
salt-pillar-root: ${{ matrix.salt_pillar_root }}
lint_powershell:
name: PowerShell Linting
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
$files = Get-ChildItem -Path ./ -Include *.ps1 -Recurse
Write-Host "--- Starting PowerShell Static Analysis ---"
$anyErrors = $false
foreach ($file in $files) {
$relativePath = $file.FullName.Replace($PWD.ProviderPath, ".")
$results = Invoke-ScriptAnalyzer -Path $file.FullName -Severity Warning
if ($results) {
Write-Host "FAIL: $relativePath" -ForegroundColor Red
$results | Format-Table -AutoSize
$anyErrors = $true
} else {
Write-Host "PASS: $relativePath" -ForegroundColor Green
}
}
if ($anyErrors) {
Write-Error "Static analysis failed. Please fix the errors above."
exit 1
} else {
Write-Host "--- All files passed analysis! ---"
}