|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [stable, dev] |
| 6 | + pull_request: |
| 7 | + branches: [stable] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint-powershell: |
| 11 | + name: PSScriptAnalyzer |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Install PSScriptAnalyzer |
| 17 | + shell: pwsh |
| 18 | + run: Install-Module PSScriptAnalyzer -Force -Scope CurrentUser |
| 19 | + |
| 20 | + - name: Analyze scripts |
| 21 | + shell: pwsh |
| 22 | + run: | |
| 23 | + $settings = './.github/PSScriptAnalyzerSettings.psd1' |
| 24 | + $results = Invoke-ScriptAnalyzer -Path ./scripts -Recurse -Severity Warning,Error -Settings $settings |
| 25 | + if ($results) { |
| 26 | + $results | Format-Table -AutoSize |
| 27 | + exit 1 |
| 28 | + } |
| 29 | + Write-Host "[+] PSScriptAnalyzer: scripts/ clean." |
| 30 | +
|
| 31 | + - name: Analyze module |
| 32 | + shell: pwsh |
| 33 | + run: | |
| 34 | + $settings = './.github/PSScriptAnalyzerSettings.psd1' |
| 35 | + $results = Invoke-ScriptAnalyzer -Path ./ADMappingToolkit.psm1 -Severity Warning,Error -Settings $settings |
| 36 | + if ($results) { |
| 37 | + $results | Format-Table -AutoSize |
| 38 | + exit 1 |
| 39 | + } |
| 40 | + Write-Host "[+] PSScriptAnalyzer: ADMappingToolkit.psm1 clean." |
| 41 | +
|
| 42 | + lint-python: |
| 43 | + name: Python syntax |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + |
| 48 | + - name: Syntax check |
| 49 | + run: | |
| 50 | + python3 -m py_compile tools/Invoke-PSEncoder.py |
| 51 | + echo "[+] Python syntax OK." |
| 52 | +
|
| 53 | + verify-structure: |
| 54 | + name: Verify structure |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Check required files |
| 60 | + run: | |
| 61 | + required=( |
| 62 | + "ADMappingToolkit.psm1" |
| 63 | + "scripts/Check-All.ps1" |
| 64 | + "scripts/Check-Servers.ps1" |
| 65 | + "scripts/Check-Clients.ps1" |
| 66 | + "tools/Invoke-PSEncoder.py" |
| 67 | + "tools/Sign-Scripts.ps1" |
| 68 | + "docs/index.html" |
| 69 | + "docs/doc.html" |
| 70 | + ) |
| 71 | + fail=0 |
| 72 | + for f in "${required[@]}"; do |
| 73 | + if [ ! -f "$f" ]; then |
| 74 | + echo "[!] Missing: $f" |
| 75 | + fail=1 |
| 76 | + else |
| 77 | + echo "[+] $f" |
| 78 | + fi |
| 79 | + done |
| 80 | + exit $fail |
0 commit comments