generated from PSModule/Template-Action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
49 lines (45 loc) · 1.56 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
name: Invoke-ScriptAnalyzer (by PSModule)
description: Runs PSScriptAnalyzer on the code.
author: PSModule
branding:
icon: check-square
color: gray-dark
inputs:
Path:
description: The path to the code to test.
required: true
default: ${{ github.workspace }}
Settings:
description: The type of tests to run. Can be either 'Module', 'SourceCode' or 'Custom'.
required: false
default: 'Custom'
SettingsFilePath:
description: If 'Custom' is selected, the path to the settings file.
required: false
default: ${{ github.workspace }}/.github/linters/.powershell-psscriptanalyzer.psd1
outputs:
passed:
description: If the tests passed.
value: ${{ steps.test.outputs.Passed }}
runs:
using: composite
steps:
- name: Get test paths
uses: PSModule/Github-Script@v1
id: paths
env:
GITHUB_ACTION_INVOKE_SCRIPTANALYZER_INPUT_Path: ${{ inputs.Path }}
GITHUB_ACTION_INVOKE_SCRIPTANALYZER_INPUT_Settings: ${{ inputs.Settings }}
GITHUB_ACTION_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath: ${{ inputs.SettingsFilePath }}
with:
Script: ${{ github.action_path }}/scripts/main.ps1
- name: Invoke-Pester
uses: PSModule/Invoke-Pester@v2
id: test
env:
Settings: ${{ fromJson(steps.paths.outputs.result).Settings }}
SettingsFilePath: ${{ fromJson(steps.paths.outputs.result).SettingsFilePath }}
with:
TestResult_TestSuiteName: PSScriptAnalyzer
Path: ${{ github.action_path }}/scripts/tests/PSScriptAnalyzer
Run_Path: ${{ inputs.Path }}