diff --git a/Build.ps1 b/Build.ps1 deleted file mode 100644 index 756bc75..0000000 --- a/Build.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse } - -# Evaluate next version based on AppVeyor build version -$actual_version = "$env:APPVEYOR_BUILD_VERSION" -Write-Host "Set version to $actual_version" - -# Set version on project files -ls */*/project.json | foreach { echo $_.FullName} | -foreach { - $content = get-content "$_" - $content = $content.Replace("99.99.99", $actual_version) - set-content "$_" $content -encoding UTF8 -} - -& dotnet restore -if ($LASTEXITCODE -ne 0) -{ - throw "dotnet restore failed with exit code $LASTEXITCODE" -} - -& dotnet test .\test\StrangerData.UnitTests -c Release -if ($LASTEXITCODE -ne 0) -{ - throw "dotnet test failed with exit code $LASTEXITCODE" -} - -& dotnet pack .\src\StrangerData -c Release -o .\artifacts -& dotnet pack .\src\StrangerData.SqlServer -c Release -o .\artifacts - -# Rollback version on project files -ls */*/project.json | foreach { echo $_.FullName} | -foreach { - $content = get-content "$_" - $content = $content.Replace($actual_version, "99.99.99") - set-content "$_" $content -encoding UTF8 -} \ No newline at end of file diff --git a/README.md b/README.md index 27fbf82..b274109 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # StrangerData - A .NET database populator for testing purposes -[![Travis](https://travis-ci.org/stone-pagamentos/StrangerData.svg?branch=master)](https://travis-ci.org/stone-pagamentos/StrangerData) - ## Project Description ## StrangerData is a tool designed to automatically fills your database with random data to make your unit/integration tests faster. The generator will auto maps all foreign keys and generates records to related tables. diff --git a/StrangerData.sln b/StrangerData.sln index 56eaf6a..648d55a 100644 --- a/StrangerData.sln +++ b/StrangerData.sln @@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2E7DA56A-5858-41A7-9E24-15C4F16725D1}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{27D63A1A-217A-4B44-8E03-1D24FF54055D}" + ProjectSection(SolutionItems) = preProject + azure-pipelines.yml = azure-pipelines.yml + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dialect", "Dialect", "{3EE881EC-A9FE-40DF-ACFC-DAFD844013F9}" EndProject diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 008ebdb..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Build worker image (VM template) -image: Visual Studio 2015 - -# scripts that are called at very beginning, before repo cloning -init: - - git config --global core.autocrlf input - -version: 2.0.{build} - -pull_requests: - do_not_increment_build_number: true - -nuget: - disable_publish_on_pr: true - -build_script: -- ps: .\Build.ps1 - -test: off - -artifacts: -- path: .\**\*.nupkg - name: NuGet - -deploy: - - provider: NuGet - server: https://www.nuget.org/api/v2/package - api_key: - secure: wsLtl0n7iO6nyH44qhjh8EsVtzoV+5URLhQMBCVzHv3Td3rV8zgkjX7++s19LhF3 - skip_symbols: true - on: - branch: master \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..3a678ca --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,52 @@ +trigger: + - "*" +name: $(Date:yyyyMMdd)$(Rev:.r) + +jobs: + - job: buildNugetPackage + displayName: "Build packages" + pool: + vmImage: 'ubuntu-latest' + variables: + sourceDirectory: $(System.DefaultWorkingDirectory) + buildConfiguration: 'Release' + testResultsDirectory: $(System.DefaultWorkingDirectory)/TestResults + coverageSummaryFile: $(testResultsDirectory)/**/coverage.cobertura.xml + steps: + - task: DotNetCoreCLI@2 + displayName: "Restore solution" + inputs: + command: 'restore' + projects: '$(sourceDirectory)' + feedsToUse: 'select' + vstsFeed: 'ProcessorArtifacts' + + - script: dotnet test $(sourceDirectory) --configuration Debug --no-restore --logger trx + displayName: 'Run tests' + + - task: PublishTestResults@2 + displayName: "Publish test results" + inputs: + testResultsFormat: 'VSTest' + testResultsFiles: '**/*.trx' + searchFolder: '$(testResultsDirectory)' + failTaskOnFailedTests: true + buildConfiguration: '$(buildConfiguration)' + + - task: PublishCodeCoverageResults@1 + displayName: "Publish code coverage" + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: $(coverageSummaryFile) + + - powershell: | + $cmd = 'dotnet pack --configuration $(buildConfiguration) --output "$(Build.ArtifactStagingDirectory)" --verbosity Normal' + If ('$(ShouldOverridePackageVersion)' -Eq 'true') { $cmd += ' -p:PackageVersion=$(OverridenPackageVersion)' } + Write-Output "ShouldOverridePackageVersion: $(ShouldOverridePackageVersion)"; + Write-Output "$cmd" + Invoke-Expression $cmd; + displayName: 'Pack projects' + + - publish: "$(Build.ArtifactStagingDirectory)" + artifact: drop + displayName: 'Publish Artifacts: drop'