diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index c0310a6f..81fbec0e 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -7,14 +7,26 @@ on: [pull_request] jobs: ActionTestSrc: strategy: + fail-fast: false matrix: - path: [src, outputs/module] + path: [tests/src, tests/outputs/modules] name: Action-Test - [${{ matrix.path }}] runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 + - name: Checkout tests -> PSModuleTest + uses: actions/checkout@v4 + with: + repository: PSModule/PSModuleTest + path: tests + + - name: Show files + shell: pwsh + run: | + Get-ChildItem -Recurse | Select-Object -ExpandProperty FullName | Sort-Object + - name: Initialize environment uses: PSModule/Initialize-PSModule@main diff --git a/outputs/module/PSModule/PSModule.psd1 b/outputs/module/PSModule/PSModule.psd1 deleted file mode 100644 index 87f983b3..00000000 --- a/outputs/module/PSModule/PSModule.psd1 +++ /dev/null @@ -1,27 +0,0 @@ -@{ - RootModule = 'PSModule.psm1' - ModuleVersion = '0.0.1' - CompatiblePSEditions = 'Core', 'Desktop' - GUID = '567bd93a-a0d5-4715-8cdf-6b5089d73065' - Author = 'PSModule' - CompanyName = 'PSModule' - Copyright = '(c) 2024 PSModule. All rights reserved.' - Description = 'PSModule Framework Test Module' - PowerShellVersion = '7.0' - ProcessorArchitecture = 'None' - RequiredAssemblies = @() - ScriptsToProcess = @() - TypesToProcess = @() - FormatsToProcess = @() - NestedModules = @() - FunctionsToExport = 'Test-PSModule' - CmdletsToExport = @() - AliasesToExport = @() - ModuleList = @() - FileList = 'PSModule.psd1', 'PSModule.psm1' - PrivateData = @{ - PSData = @{ - Tags = 'PSEdition_Desktop', 'PSEdition_Core' - } - } -} diff --git a/outputs/module/PSModule/PSModule.psm1 b/outputs/module/PSModule/PSModule.psm1 deleted file mode 100644 index 131dcffb..00000000 --- a/outputs/module/PSModule/PSModule.psm1 +++ /dev/null @@ -1,18 +0,0 @@ -Function Test-PSModule { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Test-PSModule -Name 'World' - - "Hello, World!" - #> - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/PSModule/PSModule.psd1 b/src/PSModule/PSModule.psd1 deleted file mode 100644 index d17e4eb8..00000000 --- a/src/PSModule/PSModule.psd1 +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ModuleVersion = '0.0.1' - RootModule = 'PSModule.psm1' - Author = 'PSModule' - Description = 'PSModule Framework Test Module' -} diff --git a/src/PSModule/PSModule.psm1 b/src/PSModule/PSModule.psm1 deleted file mode 100644 index 302c035f..00000000 --- a/src/PSModule/PSModule.psm1 +++ /dev/null @@ -1,32 +0,0 @@ -[Cmdletbinding()] -param() - -Write-Verbose 'Importing subcomponents' -$Folders = 'classes', 'private', 'public' -# Import everything in these folders -Foreach ($Folder in $Folders) { - $Root = Join-Path -Path $PSScriptRoot -ChildPath $Folder - Write-Verbose "Processing folder: $Root" - if (Test-Path -Path $Root) { - Write-Verbose "Getting all files in $Root" - $Files = $null - $Files = Get-ChildItem -Path $Root -Include '*.ps1', '*.psm1' -Recurse - # dot source each file - foreach ($File in $Files) { - Write-Verbose "Importing $($File)" - Import-Module $File - Write-Verbose "Importing $($File): Done" - } - } -} - -$Param = @{ - Function = (Get-ChildItem -Path "$PSScriptRoot\public" -Include '*.ps1' -Recurse).BaseName - Variable = '*' - Cmdlet = '*' - Alias = '*' -} - -Write-Verbose 'Exporting module members' - -Export-ModuleMember @Param diff --git a/src/PSModule/public/Test-PSModule.ps1 b/src/PSModule/public/Test-PSModule.ps1 deleted file mode 100644 index 131dcffb..00000000 --- a/src/PSModule/public/Test-PSModule.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -Function Test-PSModule { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Test-PSModule -Name 'World' - - "Hello, World!" - #> - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/tests/PSModule.Tests.ps1.ps1 b/tests/PSModule.Tests.ps1.ps1 deleted file mode 100644 index e5f39d0d..00000000 --- a/tests/PSModule.Tests.ps1.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -Describe "PSModule.Tests.ps1" { - It "Should be able to import the module" { - Import-Module -Name 'PSModule' - Get-Module -Name 'PSModule' | Should -Not -BeNullOrEmpty - Write-Verbose (Get-Module -Name 'PSModule' | Out-String) -Verbose - } - It "Should be able to call the function" { - Test-PSModuleTest -Name 'World' | Should -Be "Hello, World!" - Write-Verbose (Test-PSModuleTest -Name 'World' | Out-String) -Verbose - } -}