Skip to content

Commit f3ab1a3

Browse files
committed
Github Actions: add actions for powershell modules
1 parent 686fbea commit f3ab1a3

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
lint:
88
strategy:
99
matrix:
10-
os: [windows-2019, ubuntu-latest]
10+
os: [windows-latest, ubuntu-latest]
1111
runs-on: ${{ matrix.os }}
1212
steps:
1313
- uses: actions/checkout@v4
@@ -24,7 +24,7 @@ jobs:
2424
test:
2525
strategy:
2626
matrix:
27-
os: [windows-2019, ubuntu-latest]
27+
os: [windows-latest, ubuntu-latest]
2828
runs-on: ${{ matrix.os }}
2929
steps:
3030
- uses: actions/checkout@v4

.github/workflows/powershell.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: powershell
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
test-modules:
8+
runs-on: windows-2022
9+
steps:
10+
- uses: actions/checkout@v4
11+
- env:
12+
MODULES_DIR: modules
13+
shell: pwsh
14+
run: .\ci\tasks\test-units-bosh-psmodules\run.ps1
15+
test-stembuild-modules:
16+
runs-on: windows-2022
17+
steps:
18+
- uses: actions/checkout@v4
19+
- env:
20+
MODULES_DIR: stembuild/modules
21+
shell: pwsh
22+
run: .\ci\tasks\test-units-bosh-psmodules\run.ps1
23+
test-stembuild-automation:
24+
runs-on: windows-2022
25+
steps:
26+
- uses: actions/checkout@v4
27+
- env:
28+
MODULES_DIR: stembuild/stemcell-automation
29+
shell: pwsh
30+
run: .\ci\tasks\test-units-bosh-psmodules\run.ps1

ci/tasks/test-units-bosh-psmodules/run.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ $startupType = Get-Service "wuauserv" | Select-Object -ExpandProperty StartType
1515

1616
$result = 0
1717

18-
$testModules = Get-ChildItem "./stemcell-builder/$env:MODULES_DIR" -recurse | where {$_.name -match ".*.Tests.ps1"} | foreach {$_.DirectoryName}
18+
$repoRoot = "$PSScriptRoot\..\..\..\"
19+
Write-Host "repoRoot: $repoRoot"
20+
21+
$testModules = Get-ChildItem "$repoRoot\$env:MODULES_DIR" -recurse | where {$_.name -match ".*.Tests.ps1"} | foreach {$_.DirectoryName}
1922
foreach ($module in $testModules) {
2023
Write-Host "Testing: $module"
2124
Push-Location "$module"

stembuild/stemcell-automation/AutomationHelpers.Tests.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# not load the module.
44
BeforeAll {
55
Import-Module ../modules/BOSH.SSH
6+
Import-Module ../modules/BOSH.CFCell
67
Import-Module ../modules/BOSH.Utils
78
Import-Module ../modules/BOSH.Agent
89
Import-Module ./AutomationHelpers.psm1

0 commit comments

Comments
 (0)