From 45010e19f308d6f9a51cc2182dee69ba80788515 Mon Sep 17 00:00:00 2001 From: Choc13 Date: Thu, 21 Mar 2019 09:49:08 +0000 Subject: [PATCH 1/2] Use GitVersion as a tool. --- .travis.yml | 10 ++-- GitVersion.yml | 26 ++++++++++ GitVersionConfig.yaml | 50 ------------------- Winton.DomainModelling.DocumentDb.sln | 2 +- appveyor.yml | 8 +-- .../Winton.DomainModelling.DocumentDb.csproj | 3 -- 6 files changed, 36 insertions(+), 63 deletions(-) create mode 100644 GitVersion.yml delete mode 100644 GitVersionConfig.yaml diff --git a/.travis.yml b/.travis.yml index cdcc901..419a411 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,16 +9,16 @@ env: matrix: include: - os: linux - dotnet: 2.1.301 + dist: xenial + dotnet: 2.2 - os: osx osx_image: xcode9 # OSX 10.12 - dotnet: 2.1.301 + dotnet: 2.2.104 before_install: - ulimit -n 4096 script: - - dotnet restore - - dotnet build --configuration Release - - dotnet test test/Winton.DomainModelling.DocumentDb.Tests/ --no-build --configuration Release --framework netcoreapp2.1 + - dotnet build -c Release + - dotnet test -c Release --no-build notifications: on_success: always on_failure: always diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..6e543fe --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,26 @@ +assembly-versioning-scheme: MajorMinorPatch +mode: ContinuousDeployment + +branches: + + master: + regex: master + tag: master + increment: Minor + prevent-increment-of-merged-branch-version: true + feature: + regex: feature[/-] + tag: a{BranchName} + increment: Minor + prevent-increment-of-merged-branch-version: false + patch: + regex: patch[/-] + tag: useBranchName + increment: Patch + prevent-increment-of-merged-branch-version: false + source-branches: ['release'] + release: + regex: release[/-] + tag: rc + increment: None + prevent-increment-of-merged-branch-version: false diff --git a/GitVersionConfig.yaml b/GitVersionConfig.yaml deleted file mode 100644 index 61b7c6a..0000000 --- a/GitVersionConfig.yaml +++ /dev/null @@ -1,50 +0,0 @@ -assembly-versioning-scheme: MajorMinorPatch -mode: ContinuousDeployment - -# It would be better to use smarter regexes instead of duplicating everything for local and remote cases. -# However, GitVersion has some built-in patterns which cannot be removed and these would cause clashes. -branches: - - # These branch patterns cover all local cases - master: - regex: master - tag: master - increment: Minor - prevent-increment-of-merged-branch-version: true - feature: - regex: feature[/-] - tag: a{BranchName} - increment: Minor - prevent-increment-of-merged-branch-version: false - patch: - regex: patch[/-] - tag: useBranchName - increment: Patch - prevent-increment-of-merged-branch-version: false - release: - regex: release[/-] - tag: rc - increment: None - prevent-increment-of-merged-branch-version: false - - # These branch patterns cover all remote cases - origin/master: - regex: origin/master - tag: master - increment: Minor - prevent-increment-of-merged-branch-version: true - origin/feature: - regex: origin/feature[/-] - tag: a{BranchName} - increment: Minor - prevent-increment-of-merged-branch-version: false - origin/patch: - regex: origin/patch[/-] - tag: useBranchName - increment: Patch - prevent-increment-of-merged-branch-version: false - origin/release: - regex: origin/release[/-] - tag: rc - increment: None - prevent-increment-of-merged-branch-version: false diff --git a/Winton.DomainModelling.DocumentDb.sln b/Winton.DomainModelling.DocumentDb.sln index 0b1830e..459d64c 100644 --- a/Winton.DomainModelling.DocumentDb.sln +++ b/Winton.DomainModelling.DocumentDb.sln @@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .travis.yml = .travis.yml appveyor.yml = appveyor.yml CONTRIBUTING.md = CONTRIBUTING.md - GitVersionConfig.yaml = GitVersionConfig.yaml + GitVersion.yml = GitVersion.yml icon.jpg = icon.jpg LICENSE = LICENSE README.md = README.md diff --git a/appveyor.yml b/appveyor.yml index e8763a9..5cb8d30 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,12 +14,12 @@ install: - ps: Import-Module "C:\Program Files\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" - ps: Start-CosmosDbEmulator -NoUI -Timeout 0 before_build: - - dotnet restore + - dotnet tool install -g GitVersion.Tool --version 4.0.1-beta1-58 + - dotnet gitversion /l console /output buildserver build_script: - - msbuild /p:GetVersion=True /p:WriteVersionInfoToBuildLog=True + - dotnet build -c Release -p:Version=%GitVersion_NuGetVersion% test_script: - - dotnet test test/Winton.DomainModelling.DocumentDb.Tests/ --no-build --configuration Release - - dotnet test test/Winton.DomainModelling.DocumentDb.IntegrationTests/ --no-build --configuration Release + - dotnet test -c Release --no-build artifacts: - path: .\**\*.nupkg name: NuGet diff --git a/src/Winton.DomainModelling.DocumentDb/Winton.DomainModelling.DocumentDb.csproj b/src/Winton.DomainModelling.DocumentDb/Winton.DomainModelling.DocumentDb.csproj index 925a69b..a46d209 100644 --- a/src/Winton.DomainModelling.DocumentDb/Winton.DomainModelling.DocumentDb.csproj +++ b/src/Winton.DomainModelling.DocumentDb/Winton.DomainModelling.DocumentDb.csproj @@ -6,7 +6,6 @@ Copyright 2018 Winton Provides common types for persisting domain objects to DocumentDB. True - False $(NoWarn);SA1101;SA1309 Winton.DomainModelling.DocumentDb https://raw.githubusercontent.com/wintoncode/Winton.DomainModelling.DocumentDb/master/icon.jpg @@ -20,7 +19,6 @@ netstandard1.6 Winton Domain Modelling DocumentDB True - False @@ -32,7 +30,6 @@ - From c8d1eee478484c020fc02b3be6e7024dc8694abf Mon Sep 17 00:00:00 2001 From: Choc13 Date: Thu, 21 Mar 2019 10:36:49 +0000 Subject: [PATCH 2/2] Disable integration tests on Travis build. --- .travis.yml | 2 +- .../EntityDtoPersistenceTests.cs | 1 + .../EntityPersistenceTests.cs | 1 + .../ValueObjectDtoPersistenceTests.cs | 1 + .../ValueObjectPersistenceTests.cs | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 419a411..962a9c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ matrix: - ulimit -n 4096 script: - dotnet build -c Release - - dotnet test -c Release --no-build + - dotnet test -c Release --no-build --filter Integration!=true notifications: on_success: always on_failure: always diff --git a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityDtoPersistenceTests.cs b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityDtoPersistenceTests.cs index 023a3eb..8a26419 100644 --- a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityDtoPersistenceTests.cs +++ b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityDtoPersistenceTests.cs @@ -14,6 +14,7 @@ namespace Winton.DomainModelling.DocumentDb { + [Trait("Integration", "true")] public class EntityDtoPersistenceTests : IDisposable { private readonly Database _database; diff --git a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityPersistenceTests.cs b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityPersistenceTests.cs index 7011f61..2f6c8b0 100644 --- a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityPersistenceTests.cs +++ b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/EntityPersistenceTests.cs @@ -14,6 +14,7 @@ namespace Winton.DomainModelling.DocumentDb { + [Trait("Integration", "true")] public class EntityPersistenceTests : IDisposable { private readonly Database _database; diff --git a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectDtoPersistenceTests.cs b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectDtoPersistenceTests.cs index d6b5389..3816b53 100644 --- a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectDtoPersistenceTests.cs +++ b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectDtoPersistenceTests.cs @@ -12,6 +12,7 @@ namespace Winton.DomainModelling.DocumentDb { + [Trait("Integration", "true")] public class ValueObjectDtoPersistenceTests : IDisposable { private readonly Database _database; diff --git a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectPersistenceTests.cs b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectPersistenceTests.cs index cdfb5e3..203c91b 100644 --- a/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectPersistenceTests.cs +++ b/test/Winton.DomainModelling.DocumentDb.IntegrationTests/ValueObjectPersistenceTests.cs @@ -13,6 +13,7 @@ namespace Winton.DomainModelling.DocumentDb { + [Trait("Integration", "true")] public class ValueObjectPersistenceTests : IDisposable { private readonly Database _database;