diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000000..52ce930b65 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,24 @@ +name: "build and test" +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build-test: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@master + with: + dotnet-version: 3.1.100 + + - name: Build All + run: .\build-all.ps1 + working-directory: .\build + shell: powershell + + - name: Test All + run: .\test-all.ps1 + working-directory: .\build + shell: powershell diff --git a/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs b/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs index 212788728b..5eb90ed81e 100644 --- a/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs +++ b/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs @@ -5,7 +5,6 @@ using Shouldly; using Volo.Abp.Application.Dtos; using Volo.Abp.Validation; -using Microsoft.EntityFrameworkCore.Internal; namespace Acme.BookStore { diff --git a/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/EntityFrameworkCore/PostgeSqlDemoEntityFrameworkCoreTestModule.cs b/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/EntityFrameworkCore/PostgeSqlDemoEntityFrameworkCoreTestModule.cs index 18d5c3cd90..4ff41938e0 100644 --- a/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/EntityFrameworkCore/PostgeSqlDemoEntityFrameworkCoreTestModule.cs +++ b/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/EntityFrameworkCore/PostgeSqlDemoEntityFrameworkCoreTestModule.cs @@ -28,7 +28,10 @@ private void ConfigureInMemorySqlite(IServiceCollection services) services.Configure(options => { - options.Configure(context => { context.DbContextOptions.UseSqlite(_sqliteConnection); }); + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection, sqliteOptions => sqliteOptions.UseNetTopologySuite()); + }); }); } @@ -43,7 +46,10 @@ private static SqliteConnection CreateDatabaseAndGetConnection() connection.Open(); var options = new DbContextOptionsBuilder() - .UseSqlite(connection) + .UseSqlite(connection, sqliteOptions => + { + sqliteOptions.UseNetTopologySuite(); + }) .Options; using (var context = new PostgeSqlDemoMigrationsDbContext(options)) diff --git a/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/PostgeSqlDemo.EntityFrameworkCore.Tests.csproj b/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/PostgeSqlDemo.EntityFrameworkCore.Tests.csproj index 3ee7cdbaff..fbff54c5d4 100644 --- a/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/PostgeSqlDemo.EntityFrameworkCore.Tests.csproj +++ b/PostgeSqlDemo/test/PostgeSqlDemo.EntityFrameworkCore.Tests/PostgeSqlDemo.EntityFrameworkCore.Tests.csproj @@ -16,6 +16,7 @@ + diff --git a/README.md b/README.md index cbde9c4150..634e07dec8 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,4 @@ Also see https://github.com/abpframework/abp/tree/dev/samples ### Pull Requests * You can send PRs to this repository. +* When you create a new project, please update the [`common.ps1`](build/common.ps1) file. diff --git a/build/build-all.ps1 b/build/build-all.ps1 new file mode 100644 index 0000000000..ffaffa67a3 --- /dev/null +++ b/build/build-all.ps1 @@ -0,0 +1,16 @@ +. ".\common.ps1" + +# Build all solutions + +foreach ($solutionPath in $solutionPaths) { + $solutionAbsPath = (Join-Path $rootFolder $solutionPath) + Set-Location $solutionAbsPath + dotnet build + if (-Not $?) { + Write-Host ("Build failed for the solution: " + $solutionPath) + Set-Location $rootFolder + exit $LASTEXITCODE + } +} + +Set-Location $rootFolder diff --git a/build/common.ps1 b/build/common.ps1 new file mode 100644 index 0000000000..7bff0cb5ad --- /dev/null +++ b/build/common.ps1 @@ -0,0 +1,21 @@ +# COMMON PATHS + +$rootFolder = (Get-Item -Path "./" -Verbose).FullName + +# List of solutions + +$solutionPaths = ( + "../aspnet-core/Authentication-Customization", + "../BasicAspNetCoreApplication", + "../BasicConsoleApplication", + "../BookStore", + "../BookStore-Angular-MongoDb/aspnet-core", + "../BookStore-Modular/modules/book-management", + "../BookStore-Modular/application", + "../DashboardDemo", + "../EfCoreMigrationDemo", + "../PostgeSqlDemo", + "../RabbitMqEventBus", + "../SignalRDemo", + "../TextTemplateDemo" +) \ No newline at end of file diff --git a/build/test-all.ps1 b/build/test-all.ps1 new file mode 100644 index 0000000000..1465bff6c3 --- /dev/null +++ b/build/test-all.ps1 @@ -0,0 +1,16 @@ +. ".\common.ps1" + +# Test all solutions + +foreach ($solutionPath in $solutionPaths) { + $solutionAbsPath = (Join-Path $rootFolder $solutionPath) + Set-Location $solutionAbsPath + dotnet test --no-build --no-restore + if (-Not $?) { + Write-Host ("Test failed for the solution: " + $solutionPath) + Set-Location $rootFolder + exit $LASTEXITCODE + } +} + +Set-Location $rootFolder