-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (44 loc) · 1.57 KB
/
Copy pathci-powershell.yml
File metadata and controls
50 lines (44 loc) · 1.57 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
---
name: CI-PowerShell (called)
permissions: {}
on:
workflow_call:
jobs:
test:
name: Pester
permissions:
contents: read
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Run Pester tests
id: test
shell: powershell
run: |
New-Item -ItemType Directory -Path ./build/reports -Force | Out-Null
Import-Module Pester -RequiredVersion 5.9.0 -Force
$config = New-PesterConfiguration
$config.Run.Path = "./tests/scripts"
$config.Run.Exit = $true
$config.Output.Verbosity = "Detailed"
$config.TestResult.Enabled = $true
$config.TestResult.OutputFormat = "JUnitXml"
$config.TestResult.OutputPath = "./build/reports/junit.xml"
$config.CodeCoverage.Enabled = $true
$config.CodeCoverage.Path = @(
Get-ChildItem -Path "./scripts/windows/*.ps1" |
Select-Object -ExpandProperty FullName
)
$config.CodeCoverage.OutputFormat = "Cobertura"
$config.CodeCoverage.OutputPath = "./build/reports/coverage.xml"
Invoke-Pester -Configuration $config
- name: Upload report artifact
if: >-
always() &&
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: reports-PowerShell
path: build/reports
if-no-files-found: error