-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
86 lines (81 loc) · 2.8 KB
/
action.yml
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
79
80
81
82
83
84
85
86
name: Test-PSModule (by PSModule)
description: Test a PowerShell module before publishing the module to the PowerShell Gallery.
author: PSModule
branding:
icon: check-square
color: gray-dark
inputs:
Name:
description: The name of the module to test. The name of the repository is used if not specified.
required: false
Path:
description: The path to the code to test.
required: true
TestType:
description: The type of tests to run. Can be either 'Module' or 'SourceCode'.
required: true
TestsPath:
description: The path to the tests to run.
required: false
default: tests
StackTraceVerbosity:
description: "Verbosity level of the stack trace. Allowed values: 'None', 'FirstLine', 'Filtered', 'Full'."
required: false
default: 'Filtered'
Verbosity:
description: "Verbosity level of the test output. Allowed values: 'None', 'Normal', 'Detailed', 'Diagnostic'."
required: false
default: 'Detailed'
Debug:
description: Enable debug output.
required: false
default: 'false'
Verbose:
description: Enable verbose output.
required: false
default: 'false'
Version:
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
required: false
Prerelease:
description: Allow prerelease versions if available.
required: false
default: 'false'
outputs:
passed:
description: If the tests passed.
value: ${{ fromJSON(steps.test.outputs.result).passed }}
runs:
using: composite
steps:
- name: Run Test-PSModule
uses: PSModule/GitHub-Script@v1
id: test
env:
GITHUB_ACTION_INPUT_Name: ${{ inputs.Name }}
GITHUB_ACTION_INPUT_Path: ${{ inputs.Path }}
GITHUB_ACTION_INPUT_TestType: ${{ inputs.TestType }}
GITHUB_ACTION_INPUT_TestsPath: ${{ inputs.TestsPath }}
GITHUB_ACTION_INPUT_StackTraceVerbosity: ${{ inputs.StackTraceVerbosity }}
GITHUB_ACTION_INPUT_Verbosity: ${{ inputs.Verbosity }}
with:
Debug: ${{ inputs.Debug }}
Prerelease: ${{ inputs.Prerelease }}
Verbose: ${{ inputs.Verbose }}
Version: ${{ inputs.Version }}
ShowOutput: true
Script: |
# Test-PSModule
${{ github.action_path }}/scripts/main.ps1
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{ inputs.TestType == 'Module' && (success() || failure()) }}
with:
name: ${{ runner.os }}-Test-Report
path: ${{ github.workspace }}/outputs/Test-Report.xml
- name: Upload code coverage report
uses: actions/upload-artifact@v4
if: ${{ inputs.TestType == 'Module' && (success() || failure()) }}
with:
name: ${{ runner.os }}-CodeCoverage-Report
path: ${{ github.workspace }}/outputs/CodeCoverage-Report.xml