-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (62 loc) · 2.36 KB
/
Copy pathBeforeAll-ModuleLocal.yml
File metadata and controls
69 lines (62 loc) · 2.36 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
name: BeforeAll-ModuleLocal
on:
workflow_call:
secrets:
TestData:
description: |
Optional single-line JSON object with 'secrets' and 'variables' maps. Each entry is exposed
as an environment variable available to the BeforeAll setup script; 'secrets' values are
masked in the logs, 'variables' values are not.
required: false
inputs:
Settings:
type: string
description: The complete settings object including test suites.
required: true
permissions:
contents: read # to checkout the repo
jobs:
BeforeAll-ModuleLocal:
name: BeforeAll-ModuleLocal
runs-on: ubuntu-latest
env:
Settings: ${{ inputs.Settings }}
steps:
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 0
- name: Expose caller-provided test data
shell: pwsh
env:
PSMODULE_TEST_DATA: ${{ secrets.TestData }}
run: |
./.github/scripts/Expose-TestData.ps1
- name: Run BeforeAll Setup Scripts
uses: PSModule/GitHub-Script@8083ec1f733f00357ee4d0db0c6056686e483bc0 # v1.9.0
with:
Name: BeforeAll-ModuleLocal
ShowInfo: false
ShowOutput: true
Debug: ${{ fromJson(inputs.Settings).Debug }}
Prerelease: ${{ fromJson(inputs.Settings).Prerelease }}
Verbose: ${{ fromJson(inputs.Settings).Verbose }}
Version: ${{ fromJson(inputs.Settings).Version }}
WorkingDirectory: ${{ fromJson(inputs.Settings).WorkingDirectory }}
Script: |
LogGroup "Running BeforeAll Setup Scripts" {
$beforeAllScript = 'tests/BeforeAll.ps1'
if (-not (Test-Path $beforeAllScript)) {
Write-Host "No BeforeAll.ps1 script found at [$beforeAllScript] - exiting successfully"
exit 0
}
Write-Host "Running BeforeAll setup script: $beforeAllScript"
try {
& $beforeAllScript
Write-Host "BeforeAll script completed successfully: $beforeAllScript"
} catch {
Write-Error "BeforeAll script failed: $beforeAllScript - $_"
throw
}
}