Skip to content

Commit 5b296fe

Browse files
Add PSModuleHelpers installation step and remove deprecated helper scripts
1 parent 45990fa commit 5b296fe

File tree

5 files changed

+5
-266
lines changed

5 files changed

+5
-266
lines changed

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ inputs:
3535
runs:
3636
using: composite
3737
steps:
38+
- name: Install-PSModuleHelpers
39+
uses: PSModule/Install-PSModuleHelpers@main
40+
3841
- name: Get test paths
3942
uses: PSModule/Github-Script@v1
4043
id: paths

scripts/helpers/Convert-VersionSpec.ps1

Lines changed: 0 additions & 98 deletions
This file was deleted.

scripts/helpers/Import-PSModule.ps1

Lines changed: 0 additions & 47 deletions
This file was deleted.

scripts/helpers/Resolve-PSModuleDependency.ps1

Lines changed: 0 additions & 106 deletions
This file was deleted.

scripts/main.ps1

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
$helperPath = "$PSScriptRoot/helpers"
2-
Get-ChildItem -Path $helperPath -Filter '*.ps1' -Recurse | ForEach-Object {
3-
. $_.FullName
4-
}
5-
6-
# If test type is module, the code we ought to test is in the WorkingDirectory/outputs/module/Name folder,
1+
# If test type is module, the code we ought to test is in the WorkingDirectory/outputs/module/Name folder,
72
# otherwise it's in the WorkingDirectory/src folder.
83

94
$moduleName = if ([string]::IsNullOrEmpty($env:PSMODULE_TEST_PSMODULE_INPUT_Name)) {
@@ -18,15 +13,7 @@ $localTestPath = Resolve-Path -Path 'tests' | Select-Object -ExpandProperty Path
1813
switch ($settings) {
1914
'Module' {
2015
$modulePath = Resolve-Path -Path "outputs/module/$moduleName" | Select-Object -ExpandProperty Path
21-
$manifestFilePath = Join-Path -Path $modulePath "$moduleName.psd1"
22-
Write-Verbose " - Manifest file path: [$manifestFilePath]" -Verbose
23-
Resolve-PSModuleDependency -ManifestFilePath $manifestFilePath
24-
$PSModulePath = $env:PSModulePath -split [System.IO.Path]::PathSeparator | Select-Object -First 1
25-
$codePath = New-Item -Path "$PSModulePath/$moduleName/999.0.0" -ItemType Directory -Force | Select-Object -ExpandProperty FullName
26-
Copy-Item -Path "$modulePath/*" -Destination $codePath -Recurse -Force
27-
LogGroup 'Importing module' {
28-
Import-Module -Name $moduleName -Verbose
29-
}
16+
Install-PSModule -Path $modulePath
3017
}
3118
'SourceCode' {
3219
$codePath = Resolve-Path -Path 'src' | Select-Object -ExpandProperty Path

0 commit comments

Comments
 (0)