-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (71 loc) · 2.11 KB
/
ci.yml
File metadata and controls
80 lines (71 loc) · 2.11 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches: [stable, dev]
pull_request:
branches: [stable]
jobs:
lint-powershell:
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install PSScriptAnalyzer
shell: pwsh
run: Install-Module PSScriptAnalyzer -Force -Scope CurrentUser
- name: Analyze scripts
shell: pwsh
run: |
$settings = './.github/PSScriptAnalyzerSettings.psd1'
$results = Invoke-ScriptAnalyzer -Path ./scripts -Recurse -Severity Warning,Error -Settings $settings
if ($results) {
$results | Format-Table -AutoSize
exit 1
}
Write-Host "[+] PSScriptAnalyzer: scripts/ clean."
- name: Analyze module
shell: pwsh
run: |
$settings = './.github/PSScriptAnalyzerSettings.psd1'
$results = Invoke-ScriptAnalyzer -Path ./ADMappingToolkit.psm1 -Severity Warning,Error -Settings $settings
if ($results) {
$results | Format-Table -AutoSize
exit 1
}
Write-Host "[+] PSScriptAnalyzer: ADMappingToolkit.psm1 clean."
lint-python:
name: Python syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Syntax check
run: |
python3 -m py_compile tools/Invoke-PSEncoder.py
echo "[+] Python syntax OK."
verify-structure:
name: Verify structure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check required files
run: |
required=(
"ADMappingToolkit.psm1"
"scripts/Check-All.ps1"
"scripts/Check-Servers.ps1"
"scripts/Check-Clients.ps1"
"tools/Invoke-PSEncoder.py"
"tools/Sign-Scripts.ps1"
"docs/index.html"
"docs/doc.html"
)
fail=0
for f in "${required[@]}"; do
if [ ! -f "$f" ]; then
echo "[!] Missing: $f"
fail=1
else
echo "[+] $f"
fi
done
exit $fail