ci: DEVOPS-3481 adding back cache (reduces build time by 1h)

This commit is contained in:
Jakub Cuth
2025-06-19 11:14:19 +02:00
parent 366f7eb4e0
commit 47316a1843
4 changed files with 32 additions and 13 deletions

View File

@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#!/bin/bash
$scriptpath = $MyInvocation.MyCommand.Path
$scriptDir = Split-Path $scriptpath
$bridgeRepoRootDir = Join-Path $scriptDir "../../../.." -Resolve
@ -24,6 +22,26 @@ Write-host "Bridge-gui directory is $scriptDir"
Write-host "Bridge repos root dir $bridgeRepoRootDir"
Push-Location $scriptDir
# There is bug in CI caused by defining the lower case and upper case
# vars for proxy. For pure bash (case sensitive - creating
# two env items) or pure powershell (case insensitive - by default writes any
# changes into first defined env instance) it is transparent. But during bridge gui
# build we are populating case sensitive env vars from bash to powershell which
# then cause error when trying to list env vars. This is causing an error
# during CMake lookup for CXX and build fails. Therefore we need unset the
# lower case version if present.
Write-Host "Checking for duplicate proxy variables..."
@("HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY") | ForEach-Object {
$upper = $_
$lower = $_.ToLower()
if ((Test-Path "Env:$upper") -and (Test-Path "Env:$lower")) {
Write-Host "Removing duplicate lowercase variable: $lower"
Remove-Item "Env:$lower" -ErrorAction SilentlyContinue
}
}
$ErrorActionPreference = "Stop"
$cmakeExe=$(Get-Command cmake).source