-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (67 loc) · 2.38 KB
/
test.yml
File metadata and controls
73 lines (67 loc) · 2.38 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
name: test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
# Opt in to Node 24 runtime for actions/* (Node 20 is deprecated;
# forced default in June 2026, removed in September 2026).
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
# Top-level read-only token per OpenSSF Scorecard `Token-Permissions`;
# jobs scope up only when needed.
permissions: read-all
jobs:
headless:
name: Pure-logic tests (pwsh 7.5+)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
- name: Install PowerShell 7.5+ (SnipIT.ps1 requires it)
shell: bash
run: |
dotnet tool install --global PowerShell
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
- name: Show pwsh version
shell: bash
run: pwsh --version
- name: Run headless tests
shell: bash
run: pwsh -NoProfile -File ./Test-SnipIT.ps1
# PSScriptAnalyzer moved to .github/workflows/security.yml per RAN-54 — it is
# the language-specific lint slot in the OSS-CLI security stack (codeiq's
# SpotBugs equivalent), not a build-time gate.
parse:
name: Parse SnipIT.ps1 on Windows (no execution)
runs-on: windows-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
- name: Install PowerShell 7.5+ (SnipIT.ps1 requires it)
shell: pwsh
run: |
dotnet tool install --global PowerShell
"$HOME\.dotnet\tools" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Show pwsh version
shell: bash
run: pwsh --version
- name: Parse script (AST parser works with any pwsh version)
shell: bash
run: |
pwsh -NoProfile -Command "
\$errors = \$null
[System.Management.Automation.Language.Parser]::ParseFile(
(Resolve-Path ./SnipIT.ps1), [ref]\$null, [ref]\$errors) | Out-Null
if (\$errors) {
\$errors | ForEach-Object { Write-Host \" \$(\$_.Message) at line \$(\$_.Extent.StartLineNumber)\" }
exit 1
}
Write-Host 'Parsed cleanly.'
"
- name: Run headless tests on Windows
shell: bash
run: pwsh -NoProfile -File ./Test-SnipIT.ps1