Skip to content

Commit 9eda038

Browse files
committed
Add static PowerShell module CI
1 parent 81f68fe commit 9eda038

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
powershell-module-static-smoke:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Parse PowerShell module files
19+
shell: pwsh
20+
run: |
21+
$targets = @(
22+
'./PSFeedHandler/PSFeedHandler.psd1',
23+
'./PSFeedHandler/PSFeedHandler.psm1'
24+
)
25+
26+
foreach ($path in $targets) {
27+
$parseErrors = $null
28+
$tokens = $null
29+
[void][System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path $path), [ref]$tokens, [ref]$parseErrors)
30+
if ($parseErrors.Count -gt 0) {
31+
$parseErrors | ForEach-Object { Write-Error ("{0}: {1}" -f $path, $_.Message) }
32+
exit 1
33+
}
34+
}
35+
36+
Write-Host 'PSFeedHandler static PowerShell parse checks passed.'
37+
38+
# Intentionally lightweight:
39+
# - validates the module manifest and main module file parse cleanly
40+
# - avoids fake network/feed-runtime claims in default CI

0 commit comments

Comments
 (0)