7070 fail-fast : false
7171 matrix :
7272 os : [ windows-latest, ubuntu-latest, macos-latest ]
73+ shell : [ pwsh ]
74+ include :
75+ - os : windows-latest
76+ shell : powershell
7377 steps :
7478 - name : Download build.requires.psd1
7579 uses : actions/download-artifact@v8
@@ -79,39 +83,37 @@ jobs:
7983 uses : actions/download-artifact@v8
8084 with :
8185 name : ModuleBuilder
82- path : output /ModuleBuilder # /home/runner/work/ModuleBuilder/ModuleBuilder/output/ModuleBuilder
86+ path : Modules /ModuleBuilder # /home/runner/work/ModuleBuilder/ModuleBuilder/output/ModuleBuilder
8387 - name : Download Pester Tests
8488 uses : actions/download-artifact@v8
8589 with :
8690 name : PesterTests
8791 path : PesterTests
8892 - name : Install Output Modules
8993 shell : pwsh
94+ env :
95+ MODULEFAST_DESTINATION : ${{ github.workspace }}/Modules
9096 run : | # PowerShell
91- # https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-powershell#powershell-module-locations
92- $ModuleDestination = if ($IsWindows) {
93- Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'PowerShell/Modules'
94- } else {
95- Join-Path $HOME '.local/share/powershell/Modules'
96- }
97-
98- Get-ChildItem -Directory output -OutVariable Modules
99- | Move-Item -Destination { Join-Path $ModuleDestination $_.Name } -Force
100-
101- Write-Host "Installing $($Modules -join ', ') to $ModuleDestination"
102- Get-ChildItem -Directory $ModuleDestination
103- Write-Host "PSModulePath:"
104- $Env:PSModulePath -split ([IO.Path]::PathSeparator) | Out-Host
97+ $Env:PSModulePath = $Env:MODULEFAST_DESTINATION + [IO.Path]::PathSeparator + $Env:PSModulePath
98+ # Just to prove that I can...
99+ Import-Module ModuleBuilder -Force -Global -PassThru | Out-Host
105100
106101 # Avoid installing ModuleBuilder with ModuleFast, so there's only one copy
107- @(Get-Content build.requires.psd1)
108- | Where { $_ -notmatch "ModuleBuilder"}
109- | Set-Content build.requires.psd1
102+ @(Get-Content build.requires.psd1) |
103+ Where { $_ -notmatch "ModuleBuilder"} |
104+ Set-Content build.requires.psd1
105+
110106 - name : ⚡ Install Required Modules
111107 uses : JustinGrote/ModuleFast-action@v0.0.1
108+ env :
109+ MODULEFAST_DESTINATION : ${{ github.workspace }}/Modules
112110 - name : Invoke-Pester
113- shell : pwsh
111+ shell : matrix.shell
112+ env :
113+ MODULEFAST_DESTINATION : ${{ github.workspace }}/Modules
114114 run : | # PowerShell
115+ $Env:PSModulePath = $Env:MODULEFAST_DESTINATION + [IO.Path]::PathSeparator + $Env:PSModulePath
116+
115117 # For the cross-platform matrix we don't need to do coverage or anything complicated
116118 $Result = Invoke-Pester . -PassThru
117119 @(
0 commit comments