From 34c187fdc5101950aa4fe2b10433ef6e0ddbe6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Andr=C3=A9=20Riboli?= Date: Wed, 17 Jul 2024 21:25:50 -0300 Subject: [PATCH 1/3] Adds azure-pipelines.yml --- StrangerData.sln | 3 +++ azure-pipelines.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 azure-pipelines.yml 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/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..e9bd53d --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,47 @@ +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) + + - script: dotnet pack --configuration $(buildConfiguration) --output "$(Build.ArtifactStagingDirectory)" + displayName: 'Pack projects' + + - publish: "$(Build.ArtifactStagingDirectory)" + artifact: drop + displayName: 'Publish Artifacts: drop' From cc321265a7aa1e43f8544f8c1ddeb393ac8ccd91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Andr=C3=A9=20Riboli?= Date: Wed, 17 Jul 2024 21:26:15 -0300 Subject: [PATCH 2/3] Removes old ci pipelines. --- Build.ps1 | 36 ------------------------------------ README.md | 2 -- appveyor.yml | 32 -------------------------------- 3 files changed, 70 deletions(-) delete mode 100644 Build.ps1 delete mode 100644 appveyor.yml 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/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 From 082a94b276a2bb77681d2bc86010d0d4d066aa14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Andr=C3=A9=20Riboli?= Date: Wed, 17 Jul 2024 23:58:25 -0300 Subject: [PATCH 3/3] Adds configuration for versioning scheme in azure-pipelines.yml --- azure-pipelines.yml | 87 ++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e9bd53d..3a678ca 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,47 +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' + - 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' - - task: PublishTestResults@2 - displayName: "Publish test results" - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '**/*.trx' - searchFolder: '$(testResultsDirectory)' - failTaskOnFailedTests: true - buildConfiguration: '$(buildConfiguration)' + - script: dotnet test $(sourceDirectory) --configuration Debug --no-restore --logger trx + displayName: 'Run tests' - - task: PublishCodeCoverageResults@1 - displayName: "Publish code coverage" - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: $(coverageSummaryFile) - - - script: dotnet pack --configuration $(buildConfiguration) --output "$(Build.ArtifactStagingDirectory)" - displayName: 'Pack projects' - - - publish: "$(Build.ArtifactStagingDirectory)" - artifact: drop - displayName: 'Publish Artifacts: drop' + - 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'