diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 662b883..c55f591 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -309,110 +309,6 @@ jobs: working-directory: ./artifacts/scaffold/ContosoSecurityPortal run: docker compose -p contososecurityportal-ci down --volumes --remove-orphans - - - name: Scaffold non-default consumer project - if: runner.os == 'Linux' - shell: pwsh - run: | - New-Item -ItemType Directory -Path ./artifacts/scaffold -Force | Out-Null - dotnet new netcoreapp-template ` - --name ContosoNoAuthSqlServer ` - --output ./artifacts/scaffold/ContosoNoAuthSqlServer ` - --skipRestore=true ` - --authProvider=none ` - --dbProvider=sqlserver - - - name: Validate non-default scaffolded configuration - if: runner.os == 'Linux' - shell: pwsh - run: | - $appsettingsPath = "./artifacts/scaffold/ContosoNoAuthSqlServer/src/ContosoNoAuthSqlServer.Web/appsettings.json" - - if (-not (Test-Path -LiteralPath $appsettingsPath -PathType Leaf)) { - Write-Error "Generated appsettings.json was not found: $appsettingsPath" - exit 1 - } - - $projectName = "ContosoNoAuthSqlServer" - $settings = Get-Content -LiteralPath $appsettingsPath -Raw | ConvertFrom-Json - $projectSettings = $settings.PSObject.Properties[$projectName].Value - - if ($null -eq $projectSettings) { - Write-Error "Expected generated appsettings root '$projectName' was not found." - exit 1 - } - - Write-Host "Generated auth enabled: $($projectSettings.Authentication.Enabled)" - Write-Host "Generated cookie enabled: $($projectSettings.Authentication.Cookie.Enabled)" - Write-Host "Generated data provider: $($projectSettings.DataAccess.Provider)" - Write-Host "Generated connection string name: $($projectSettings.DataAccess.ConnectionStringName)" - - if ($projectSettings.Authentication.Enabled -ne $false) { - Write-Error "Expected ${projectName}:Authentication:Enabled to be false." - exit 1 - } - - if ($projectSettings.Authentication.Cookie.Enabled -ne $false) { - Write-Error "Expected ${projectName}:Authentication:Cookie:Enabled to be false." - exit 1 - } - - if ($projectSettings.DataAccess.Provider -ne "SqlServer") { - Write-Error "Expected ${projectName}:DataAccess:Provider to be SqlServer." - exit 1 - } - - if ($projectSettings.DataAccess.ConnectionStringName -ne "ApplicationSqlServer") { - Write-Error "Expected ${projectName}:DataAccess:ConnectionStringName to be ApplicationSqlServer." - exit 1 - } - - $migrationPath = "./artifacts/scaffold/$projectName/src/$projectName.Infrastructure/Data/Migrations" - if (Test-Path -LiteralPath $migrationPath) { - Write-Error "SQL Server scaffold must not include the SQLite migration history." - exit 1 - } - - $migrationTests = @( - Get-ChildItem ` - -LiteralPath "./artifacts/scaffold/$projectName/tests/$projectName.Web.Tests" ` - -Filter '*MigrationTests.cs' ` - -File - ) - if ($migrationTests.Count -ne 0) { - Write-Error "SQL Server scaffold must not include SQLite migration-specific tests: $($migrationTests.Name -join ', ')" - exit 1 - } - - $migrationReferences = @( - Get-ChildItem ` - -LiteralPath "./artifacts/scaffold/$projectName/tests/$projectName.Web.Tests" ` - -Filter '*.cs' ` - -File ` - -Recurse | - Select-String -SimpleMatch "$projectName.Infrastructure.Data.Migrations" - ) - if ($migrationReferences.Count -ne 0) { - Write-Error "SQL Server scaffold contains tests that reference the omitted SQLite migration namespace." - exit 1 - } - - ./eng/Test-PackageLockFiles.ps1 -Root ./artifacts/scaffold/ContosoNoAuthSqlServer - - - name: Build non-default scaffolded output - if: runner.os == 'Linux' - shell: pwsh - working-directory: ./artifacts/scaffold/ContosoNoAuthSqlServer - run: | - dotnet restore ./ContosoNoAuthSqlServer.slnx --locked-mode - dotnet build ./ContosoNoAuthSqlServer.slnx --configuration $env:CONFIGURATION --no-restore /p:ContinuousIntegrationBuild=true - - - name: Test non-default scaffolded output - if: runner.os == 'Linux' - shell: pwsh - working-directory: ./artifacts/scaffold/ContosoNoAuthSqlServer - run: dotnet test ./ContosoNoAuthSqlServer.slnx --configuration $env:CONFIGURATION --no-build --verbosity normal /p:ContinuousIntegrationBuild=true - - name: Uninstall template package if: always() shell: pwsh