Guilherme Silberfarb Costa commited on
Commit
7031c42
·
1 Parent(s): a20fa71

Fetch LFS assets in Windows build

Browse files
.github/workflows/build-windows-portable.yml CHANGED
@@ -11,6 +11,12 @@ jobs:
11
  steps:
12
  - name: Checkout
13
  uses: actions/checkout@v4
 
 
 
 
 
 
14
 
15
  - name: Setup Node
16
  uses: actions/setup-node@v4
 
11
  steps:
12
  - name: Checkout
13
  uses: actions/checkout@v4
14
+ with:
15
+ lfs: true
16
+
17
+ - name: Pull LFS assets
18
+ shell: pwsh
19
+ run: git lfs pull
20
 
21
  - name: Setup Node
22
  uses: actions/setup-node@v4
build/windows/smoke_test_portable.ps1 CHANGED
@@ -18,6 +18,8 @@ $loginUrl = "$rootUrl/api/auth/login"
18
  $meUrl = "$rootUrl/api/auth/me"
19
  $logoUrl = "$rootUrl/logo_mesa.png"
20
  $logradourosUrl = "$rootUrl/api/pesquisa/logradouros-eixos?limite=50"
 
 
21
 
22
  New-Item -ItemType Directory -Force -Path $configDir | Out-Null
23
  New-Item -ItemType Directory -Force -Path $runtimeDir | Out-Null
@@ -61,21 +63,43 @@ function Show-StartupDiagnostics {
61
  Write-Host "--- MesaFrame-startup.log ---"
62
  Get-Content -Path $startupLogPath
63
  }
64
- $dadosDir = Join-Path $appDirResolved "_internal/app/core/dados"
65
  if (Test-Path $dadosDir) {
66
  Write-Host "--- dados bundle ---"
67
  Get-ChildItem -Path $dadosDir | Select-Object Name, Length | Format-Table -AutoSize | Out-String | Write-Host
68
  }
69
- $logoPath = Join-Path $appDirResolved "_internal/frontend/dist/logo_mesa.png"
70
- if (Test-Path $logoPath) {
71
  Write-Host "--- logo bundle ---"
72
- Get-Item $logoPath | Select-Object FullName, Length | Format-Table -AutoSize | Out-String | Write-Host
73
  }
74
  }
75
 
76
- $proc = Start-Process -FilePath $exePath -WorkingDirectory $appDirResolved -PassThru
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
  try {
 
 
 
 
 
 
 
79
  $ok = $false
80
  for ($i = 0; $i -lt 60; $i++) {
81
  Start-Sleep -Seconds 1
@@ -102,6 +126,9 @@ try {
102
  if ($logoResp.StatusCode -ne 200) {
103
  throw "Smoke test failed: logo path returned status $($logoResp.StatusCode)."
104
  }
 
 
 
105
 
106
  $loginBody = @{
107
  usuario = "smoke"
 
18
  $meUrl = "$rootUrl/api/auth/me"
19
  $logoUrl = "$rootUrl/logo_mesa.png"
20
  $logradourosUrl = "$rootUrl/api/pesquisa/logradouros-eixos?limite=50"
21
+ $dadosDir = Join-Path $appDirResolved "_internal/app/core/dados"
22
+ $logoBundlePath = Join-Path $appDirResolved "_internal/frontend/dist/logo_mesa.png"
23
 
24
  New-Item -ItemType Directory -Force -Path $configDir | Out-Null
25
  New-Item -ItemType Directory -Force -Path $runtimeDir | Out-Null
 
63
  Write-Host "--- MesaFrame-startup.log ---"
64
  Get-Content -Path $startupLogPath
65
  }
 
66
  if (Test-Path $dadosDir) {
67
  Write-Host "--- dados bundle ---"
68
  Get-ChildItem -Path $dadosDir | Select-Object Name, Length | Format-Table -AutoSize | Out-String | Write-Host
69
  }
70
+ if (Test-Path $logoBundlePath) {
 
71
  Write-Host "--- logo bundle ---"
72
+ Get-Item $logoBundlePath | Select-Object FullName, Length | Format-Table -AutoSize | Out-String | Write-Host
73
  }
74
  }
75
 
76
+ function Assert-MinimumFileSize {
77
+ param(
78
+ [string]$Path,
79
+ [long]$MinimumBytes,
80
+ [string]$Label
81
+ )
82
+
83
+ if (-not (Test-Path $Path)) {
84
+ throw "$Label nao encontrado: $Path"
85
+ }
86
+
87
+ $item = Get-Item $Path
88
+ if ($item.Length -lt $MinimumBytes) {
89
+ throw "$Label parece truncado ($($item.Length) bytes): $Path"
90
+ }
91
+ }
92
+
93
+ $proc = $null
94
 
95
  try {
96
+ Assert-MinimumFileSize -Path $logoBundlePath -MinimumBytes 1024 -Label "Logo do bundle"
97
+ Assert-MinimumFileSize -Path (Join-Path $dadosDir "EixosLogradouros.shp") -MinimumBytes 1000000 -Label "Shapefile de eixos"
98
+ Assert-MinimumFileSize -Path (Join-Path $dadosDir "EixosLogradouros.dbf") -MinimumBytes 1000000 -Label "Tabela DBF de eixos"
99
+ Assert-MinimumFileSize -Path (Join-Path $dadosDir "Bairros_LC12112_16.shp") -MinimumBytes 1000000 -Label "Shapefile de bairros"
100
+
101
+ $proc = Start-Process -FilePath $exePath -WorkingDirectory $appDirResolved -PassThru
102
+
103
  $ok = $false
104
  for ($i = 0; $i -lt 60; $i++) {
105
  Start-Sleep -Seconds 1
 
126
  if ($logoResp.StatusCode -ne 200) {
127
  throw "Smoke test failed: logo path returned status $($logoResp.StatusCode)."
128
  }
129
+ if ([string]$logoResp.Content.Length -lt 1024) {
130
+ throw "Smoke test failed: logo response looks truncated."
131
+ }
132
 
133
  $loginBody = @{
134
  usuario = "smoke"