Files
Europa/Nuvolari/tool/verify.ps1
T
Alby96andClaude Opus 5 3fcbb9f1c4 Add monorepo scaffolding and project documentation
Sets up the Nuvolari monorepo layout (app/, backend/, docs/, tool/) with the
groundwork that does not depend on the Flutter toolchain: gitignore covering
Flutter, Python and every secret file shape; env.example.json as the template
for --dart-define-from-file; a verification script that skips stages whose
target does not exist yet so it is runnable from day one; and a CI workflow in
GitHub Actions syntax so it runs unchanged on Gitea or GitHub.

The documentation records facts verified against the live services rather than
restated from the brief. Two of them change the design:

- DPC VMI rasters are 1200x1400 Float32 on a 1 km grid in a custom projection
  centred on Italy, not EPSG:4326 or EPSG:3857, and their GeoKeys are
  internally inconsistent. Reprojection is mandatory and the source CRS must be
  read from each file rather than hardcoded.
- The ARPA CAP feed carries six level values, not four: BIANCO for the
  avalanche scale out of season and "-" for no data. Collapsing either into
  VERDE would report "no alert" where the bulletin reports "not assessed".

Also documents why the frames we publish inherit CC BY-SA from the DPC source,
and why rain notifications subscribe to cell topics from the device so no user
location ever reaches a server.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 10:50:40 +02:00

109 lines
2.6 KiB
PowerShell

<#
.SYNOPSIS
Runs the full verification loop for the Nuvolari monorepo.
.DESCRIPTION
Stages run in order and the script stops at the first failure, because a
formatting or analysis error makes the later stages' output noise.
Stages whose target does not exist yet are skipped, so this script is
runnable from milestone 0 onwards.
.PARAMETER SkipBuild
Skips the Android app bundle build. Useful for a fast inner loop; CI never
passes this.
.EXAMPLE
.\tool\verify.ps1
.\tool\verify.ps1 -SkipBuild
#>
[CmdletBinding()]
param(
[switch]$SkipBuild
)
$ErrorActionPreference = 'Stop'
$repo = Split-Path -Parent $PSScriptRoot
$app = Join-Path $repo 'app'
$backend = Join-Path $repo 'backend'
$failures = @()
function Invoke-Stage {
param(
[string]$Name,
[string]$WorkingDirectory,
[scriptblock]$Action
)
Write-Host ""
Write-Host "==> $Name" -ForegroundColor Cyan
Push-Location $WorkingDirectory
try {
& $Action
if ($LASTEXITCODE -ne 0) {
throw "$Name failed with exit code $LASTEXITCODE"
}
Write-Host " ok" -ForegroundColor Green
}
finally {
Pop-Location
}
}
function Test-Skip {
param([string]$Path, [string]$Name)
if (-not (Test-Path $Path)) {
Write-Host ""
Write-Host "==> $Name" -ForegroundColor Cyan
Write-Host " skipped (not created yet: $Path)" -ForegroundColor DarkGray
return $true
}
return $false
}
# --- Flutter app ------------------------------------------------------------
if (-not (Test-Skip -Path (Join-Path $app 'pubspec.yaml') -Name 'Flutter app')) {
Invoke-Stage 'dart format' $app {
dart format --set-exit-if-changed .
}
Invoke-Stage 'flutter analyze' $app {
flutter analyze
}
Invoke-Stage 'flutter test' $app {
flutter test
}
if ($SkipBuild) {
Write-Host ""
Write-Host "==> flutter build appbundle" -ForegroundColor Cyan
Write-Host " skipped (-SkipBuild)" -ForegroundColor DarkGray
}
else {
Invoke-Stage 'flutter build appbundle --debug' $app {
flutter build appbundle --debug
}
}
}
# --- Python worker ----------------------------------------------------------
if (-not (Test-Skip -Path (Join-Path $backend 'pyproject.toml') -Name 'Python worker')) {
Invoke-Stage 'ruff check' $backend {
python -m ruff check .
}
Invoke-Stage 'pytest' $backend {
python -m pytest -q
}
}
Write-Host ""
Write-Host "All verification stages passed." -ForegroundColor Green