Skip to content

Commit 928b07f

Browse files
authored
Merge pull request #1 from deadlydog/IncludeTemplateFileTestsInDeployments
fix: Copy template test files to build artifact
2 parents e29faba + 3ca8208 commit 928b07f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/build-and-test-powershell-module.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ jobs:
160160
Write-Output "Copying the module files to the module artifact directory '$moduleArtifactDirectoryPath'."
161161
Copy-Item -Path $moduleDirectoryPath -Destination $moduleArtifactDirectoryPath -Exclude '*.Tests.ps1' -Recurse -Force
162162
163+
[string] $moduleTemplateRepoFilesDirectoryPath = Join-Path -Path $moduleDirectoryPath -ChildPath 'TemplateRepoFiles'
164+
Write-Output "Copying the module template repo files '$moduleTemplateRepoFilesDirectoryPath' to the module artifact directory '$moduleArtifactDirectoryPath' verbatim, to ensure test files are included."
165+
Copy-Item -Path $moduleTemplateRepoFilesDirectoryPath -Destination $moduleArtifactDirectoryPath -Recurse -Force
166+
163167
- name: Create deploy files artifact
164168
shell: pwsh
165169
run: |

deploy/Invoke-SmokeTests.ps1

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ Describe 'New-PowerShellScriptModuleRepository' {
2626
$expectedModuleTestsFilePath = Join-Path -Path $expectedModuleDirectoryPath -ChildPath "$moduleName.Tests.ps1"
2727

2828
# Act.
29-
New-PowerShellScriptModuleRepository -RepositoryDirectoryPath $repositoryDirectoryPath -ModuleName $moduleName -OrganizationName $organizationName -Verbose
30-
31-
Write-Verbose "Module directory path: $repositoryDirectoryPath" -Verbose
32-
$paths = Get-ChildItem -Path $repositoryDirectoryPath -Recurse |
33-
Select-Object -ExpandProperty FullName
34-
Write-Verbose "Paths: $paths" -Verbose
29+
New-PowerShellScriptModuleRepository -RepositoryDirectoryPath $repositoryDirectoryPath -ModuleName $moduleName -OrganizationName $organizationName
3530

3631
# Assert.
3732
$expectedModuleDirectoryPath | Should -Exist

0 commit comments

Comments
 (0)