From a215a61dc24d8828e1446be4a15cdad90d4793ea Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 30 Jan 2025 13:21:19 -0700 Subject: [PATCH] use artifact files for exe tests --- .github/workflows/admu-ci.yml | 2 ++ jumpcloud-ADMU/Powershell/Tests/Build.Tests.ps1 | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/admu-ci.yml b/.github/workflows/admu-ci.yml index 8d310985..b6cf17aa 100644 --- a/.github/workflows/admu-ci.yml +++ b/.github/workflows/admu-ci.yml @@ -149,6 +149,8 @@ jobs: uses: actions/download-artifact@v4 with: name: jumpcloud-admu-build + - name: Display structure of downloaded files + run: ls -R - uses: actions/cache@v4 with: path: 'C:\Users\runneradmin\Documents\PowerShell\Modules\' diff --git a/jumpcloud-ADMU/Powershell/Tests/Build.Tests.ps1 b/jumpcloud-ADMU/Powershell/Tests/Build.Tests.ps1 index dc6f39d3..91a547a5 100644 --- a/jumpcloud-ADMU/Powershell/Tests/Build.Tests.ps1 +++ b/jumpcloud-ADMU/Powershell/Tests/Build.Tests.ps1 @@ -99,8 +99,15 @@ Describe "Module Validation Tests" { $masterForm = (Invoke-WebRequest https://raw.githubusercontent.com/TheJumpCloud/jumpcloud-ADMU/master/jumpcloud-ADMU/Powershell/Private/DisplayForms/Form.ps1 -useBasicParsing).ToString() $masterVersion = Select-String -InputObject:($masterForm) -Pattern:($VersionRegex) $masterFormVersion = [version]$masterVersion.Matches.value - $gui_exeVersion = [version](Get-Item ("$PSScriptRoot\..\..\exe\gui_jcadmu.exe")).VersionInfo.FileVersion - $wup_exeVersion = [version](Get-Item ("$PSScriptRoot\..\..\exe\uwp_jcadmu.exe")).VersionInfo.FileVersion + if ($CI) { + $gui_exePathFromArtifact = "$GITHUB_WORKSPACE\jumpcloud-admu-build\Exe\gui_jcadmu.exe" + $uwp_exePathFromArtifact = "$GITHUB_WORKSPACE\jumpcloud-admu-build\Exe\uwp_jcadmu.exe" + } else { + $gui_exePathFromArtifact = "$PSScriptRoot\..\..\exe\gui_jcadmu.exe" + $uwp_exePathFromArtifact = "$PSScriptRoot\..\..\exe\uwp_jcadmu.exe" + } + $gui_exeVersion = [version](Get-Item ("$gui_exePathFromArtifact")).VersionInfo.FileVersion + $wup_exeVersion = [version](Get-Item ("$uwp_exePathFromArtifact")).VersionInfo.FileVersion if ($env:ModuleVersionType -eq "manual") { $gui_exeVersion | Should -be $psd1Version $wup_exeVersion | Should -be $psd1Version