Skip to content

readme

readme #220

name: .NET Multi Solutions (ASP only, safe)
on:
push:
branches: [ "main" ]
paths:
- ".github/workflows/dotnet-desktop.yml"
- ".NET ASP/**"
pull_request:
branches: [ "main" ]
paths:
- ".NET ASP/**"
workflow_dispatch:
concurrency:
group: dotnet-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
# 정식 릴리스만 설치 (프리뷰 필요하면 'dotnet-quality: preview' 주석 해제)
- name: Setup .NET SDKs (6/7/8/9)
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
7.0.x
6.0.x
# dotnet-quality: preview
cache: true
cache-dependency-path: |
**/packages.lock.json
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Restore (.NET ASP only)
shell: pwsh
run: |
$solutions = Get-ChildItem -Path ".NET ASP" -Recurse -Filter *.sln |
Where-Object { $_.FullName -notmatch '\\(bin|obj)\\' }
if (-not $solutions) { throw "No .sln files found under .NET ASP" }
foreach ($sln in $solutions) {
Write-Host "==> RESTORE $($sln.FullName)"
msbuild "$($sln.FullName)" /t:Restore /m
}
- name: Build (Release, .NET ASP only)
shell: pwsh
run: |
$solutions = Get-ChildItem -Path ".NET ASP" -Recurse -Filter *.sln |
Where-Object { $_.FullName -notmatch '\\(bin|obj)\\' }
$failures = @()
foreach ($sln in $solutions) {
Write-Host "==> BUILD $($sln.FullName)"
msbuild "$($sln.FullName)" /p:Configuration=Release /m
if ($LASTEXITCODE -ne 0) {
Write-Host "::warning:: Build failed: $($sln.FullName)"
$failures += $sln.FullName
$global:LASTEXITCODE = 0
}
}
if ($failures.Count -gt 0) {
Write-Host "Failed solutions:"; $failures | ForEach-Object { Write-Host " - $_" }
exit 1
}
- name: dotnet test (SDK-style tests under .NET ASP)
shell: pwsh
run: |
$tests = Get-ChildItem -Path ".NET ASP" -Recurse -Filter *.csproj |
Where-Object {
$_.Name -match '\.Tests?\.csproj$' -and
(Select-String -Path $_.FullName -Pattern '<TargetFramework>net(6\.0|7\.0|8\.0|9\.0)')
}
if ($tests) {
foreach ($p in $tests) {
Write-Host "==> TEST $($p.FullName)"
dotnet test "$($p.FullName)" --configuration Release --no-build --verbosity normal
}
} else {
Write-Host "No SDK-style test projects found – skipping."
}