From 505aec0cd19b425f40172189500594675971b4f4 Mon Sep 17 00:00:00 2001 From: softwaredevelop <61334390+softwaredevelop@users.noreply.github.com> Date: Sun, 19 Apr 2026 09:35:44 +0200 Subject: [PATCH] ci: add ps1 scripts --- run_dagger_develop.ps1 | 36 ++++++++++++++++++++++++++++++++++++ run_dagger_tests.ps1 | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 run_dagger_develop.ps1 create mode 100644 run_dagger_tests.ps1 diff --git a/run_dagger_develop.ps1 b/run_dagger_develop.ps1 new file mode 100644 index 0000000..487041a --- /dev/null +++ b/run_dagger_develop.ps1 @@ -0,0 +1,36 @@ +# Get the current working directory +$rootDir = Get-Location + +Write-Host "🔍 Searching for 'dagger.json' files..." + +# Recursively search for dagger.json files +$daggerFiles = Get-ChildItem -Path $rootDir -Recurse -Filter "dagger.json" + +if ($daggerFiles.Count -eq 0) { + Write-Host "⚠️ No 'dagger.json' files found. Exiting..." -ForegroundColor Yellow + exit 0 +} + +# Run in each directory where dagger.json is found +foreach ($file in $daggerFiles) { + $directory = $file.DirectoryName + Write-Host "📂 Entering directory: $directory" + Push-Location $directory + + Write-Host "🚀 Running 'dagger develop'..." + try { + dagger develop + + if ($LASTEXITCODE -ne 0) { + Write-Host "❌ 'dagger develop' failed in $directory" -ForegroundColor Red + } else { + Write-Host "✅ 'dagger develop' completed successfully in $directory" -ForegroundColor Green + } + } catch { + Write-Host "🔥 An error occurred while running 'dagger develop' in `${directory}: $_" -ForegroundColor Red + } finally { + Pop-Location + } +} + +Write-Host "🎉 All 'dagger develop' executions completed!" diff --git a/run_dagger_tests.ps1 b/run_dagger_tests.ps1 new file mode 100644 index 0000000..189669a --- /dev/null +++ b/run_dagger_tests.ps1 @@ -0,0 +1,42 @@ +# List of modules +$modules = @( + "actionlint", + "editorconfig", + "hadolint", + "hello", + "quarto", + "revive", + "ruff", + "shellcheck", + "ssh-manager", + "yamllint" +) + +# Get the current working directory +$rootDir = Get-Location + +# Run tests in each module's test directory +foreach ($module in $modules) { + $testPath = Join-Path $rootDir $module "test" + + if (Test-Path $testPath -PathType Container) { + Write-Host "📂 Entering test directory: $testPath" + Set-Location $testPath + + Write-Host "🚀 Running 'dagger call all' in $module/test..." + dagger call all + + if ($LASTEXITCODE -ne 0) { + Write-Host "❌ Dagger tests failed in $module/test" -ForegroundColor Red + } else { + Write-Host "✅ Dagger tests passed in $module/test" -ForegroundColor Green + } + + # Return to the root directory + Set-Location $rootDir + } else { + Write-Host "⚠️ Test directory not found: $testPath, skipping..." -ForegroundColor Yellow + } +} + +Write-Host "🎉 All Dagger tests completed!"