Repository navigation
78 lines (69 loc) · 2.67 KB
/
Copy pathBeforeAll-ModuleLocal.yml
File metadata and controls
78 lines (69 loc) · 2.67 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
74
75
76
77
78
name: BeforeAll-ModuleLocal
on:
workflow_call:
secrets:
TestData:
description: |
Optional single-line JSON object with 'secrets' and 'variables' maps.
The workflow exposes each entry as an environment variable for the
BeforeAll setup script. It masks 'secrets' values in the logs but does
not mask 'variables' values.
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Checkout Process-PSModule
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ job.workflow_repository }}
ref: ${{ job.workflow_sha }}
path: _wf
persist-credentials: false
- name: Install-PSModule
uses: ./_wf/.github/actions/Install-PSModule
- name: Expose caller-provided test data
uses: ./_wf/.github/actions/Expose-TestData
with:
TestData: ${{ secrets.TestData }}
- 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
}
}