Skip to content

Build and Run Test for Package #163

Build and Run Test for Package

Build and Run Test for Package #163

name: CleanArchitecture.Blazored.Dev
run-name: Build and Run Test for Package
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_run:
workflows: [ "CleanArchitecture.Blazored.Deploy" ]
types:
- completed
env:
SqlServerPassword: CleanArchitecture@123
jobs:
build-test-bootstrapblazor:
runs-on: ubuntu-latest
services:
sql-server:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: ${{ env.SqlServerPassword }}
ports:
- 1433:1433
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.x
- name: Create Generated Project
run: dotnet restore src/CleanArchitecture.Blazored.csproj
- name: Restore dependencies
run: dotnet restore CleanArchitecture.Blazored.Dev.sln
- name: Build solution
run: dotnet build --no-restore CleanArchitecture.Blazored.Dev.sln -c Release
- name: Execute Application.IntegrationTests
run: |
dotnet test -c Release --no-build src/content/CleanArchitecture.Blazored/tests/Application.IntegrationTests/Application.IntegrationTests.csproj
env:
ConnectionStrings__DefaultConnection: Server=localhost,1433;Database=CleanArchitecture_Application_IntegrationTests;User=sa;Password=${{ env.SqlServerPassword }};MultipleActiveResultSets=true;TrustServerCertificate=True;
- name: Execute Application.UnitTest
run: dotnet test -c Release --no-build src/content/CleanArchitecture.Blazored/tests/Application.UnitTests/Application.UnitTests.csproj
- name: Execute Domain.UnitTest
run: dotnet test -c Release --no-build src/content/CleanArchitecture.Blazored/tests/Domain.UnitTests/Domain.UnitTests.csproj
- name: Install Playwright
run: pwsh src/content/CleanArchitecture.Blazored/tests/WebUi.AcceptanceTests/bin/Release/net8.0/playwright.ps1 install
- name: Execute WebUi.AcceptanceTests
run: |
dotnet run --project content/CleanArchitecture.Blazored/src/WebUi/WebUi/WebUi.csproj -lp https -c Release &
dotnet test -c Release --no-build src/content/CleanArchitecture.Blazored/tests/WebUi.AcceptanceTests/WebUi.AcceptanceTests.csproj
env:
ConnectionStrings__DefaultConnection: "Server=localhost,1433;Database=CleanArchitecture_Application_AcceptanceTests.Blazored;User=sa;Password=${{ env.SqlServerPassword }};MultipleActiveResultSets=true;TrustServerCertificate=True;"
build-test-mudblazor:
runs-on: ubuntu-latest
services:
sql-server:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: 'Y'
MSSQL_SA_PASSWORD: ${{ env.SqlServerPassword }}
ports:
- 1433:1433
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.x
- name: Create Generated Project
run: dotnet restore src/CleanArchitecture.Blazored.csproj
- name: Restore dependencies
run: dotnet restore CleanArchitecture.Blazored.Dev.sln
- name: Build solution
run: dotnet build --no-restore CleanArchitecture.Blazored.Dev.sln -c Release
- name: Execute Application.IntegrationTests
run: |
dotnet test -c Release --no-build src/content/CleanArchitecture.MudBlazored/tests/Application.IntegrationTests/Application.IntegrationTests.csproj
env:
ConnectionStrings__DefaultConnection: Server=localhost,1433;Database=CleanArchitecture_Application_IntegrationTests;User=sa;Password=${{ env.SqlServerPassword }};MultipleActiveResultSets=true;TrustServerCertificate=True;
- name: Execute Application.UnitTest
run: dotnet test -c Release --no-build src/content/CleanArchitecture.MudBlazored/tests/Application.UnitTests/Application.UnitTests.csproj
- name: Execute Domain.UnitTest
run: dotnet test -c Release --no-build src/content/CleanArchitecture.MudBlazored/tests/Domain.UnitTests/Domain.UnitTests.csproj
- name: Install Playwright
run: pwsh src/content/CleanArchitecture.MudBlazored/tests/WebUi.AcceptanceTests/bin/Release/net8.0/playwright.ps1 install
- name: Execute WebUi.AcceptanceTests
run: dotnet test -c Release --no-build src/content/CleanArchitecture.MudBlazored/tests/WebUi.AcceptanceTests/WebUi.AcceptanceTests.csproj