From 81634ffb7b26b4cb5e17d3e19696681e1f168204 Mon Sep 17 00:00:00 2001 From: Frode Flaten <3436158+fflaten@users.noreply.github.com> Date: Fri, 19 Jul 2024 21:40:47 +0000 Subject: [PATCH] Improve perf in Windows CI --- .github/workflows/build-validation.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-validation.yaml b/.github/workflows/build-validation.yaml index 776be98d..c5e88d7e 100644 --- a/.github/workflows/build-validation.yaml +++ b/.github/workflows/build-validation.yaml @@ -41,15 +41,6 @@ jobs: Install-Module PSModuleDevelopment -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber Install-Module Microsoft.Graph.Authentication -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber - - name: Install PowerShell dependencies (Windows PowerShell) - if: runner.os == 'Windows' && steps.filter.outputs.pwshmodule == 'true' - shell: powershell - run: | - Set-PSRepository PSGallery -InstallationPolicy Trusted - Install-Module PSFramework -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber - Install-Module PSModuleDevelopment -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber - Install-Module Microsoft.Graph.Authentication -Force -SkipPublisherCheck -Scope CurrentUser -AllowClobber - - name: Run Pester tests if: steps.filter.outputs.pwshmodule == 'true' shell: pwsh @@ -60,6 +51,8 @@ jobs: if: runner.os == 'Windows' && steps.filter.outputs.pwshmodule == 'true' shell: powershell run: | + # Reuse downloaded modules from pwsh + $env:PSModulePath += ";$HOME\Documents\PowerShell\Modules" # Remove old test results Remove-Item -Path TestResults -Recurse -Force -ErrorAction SilentlyContinue # Run Pester tests on Windows PowerShell