Skip to content

Commit

Permalink
Added GitVersion to automatically increment package and assembly vers…
Browse files Browse the repository at this point in the history
…ion (#19)

***NO_CI*** the resulting commit of this PR needs to be tagged with the initial version before the CI pipeline can run

* Added GitVersion

* Updated publishFeedCredentials to use organisation-owned API key

* Added contributing guidelines

* Enabled code coverage
  • Loading branch information
ewingjm authored Oct 1, 2020
1 parent f0cfb15 commit f850f9d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing

Please first discuss the change you wish to make via an issue before making a change.

## Pull request process

1. Ensure that there are automated tests that cover any changes
1. Update the README.md with details of any significant changes to functionality
1. Ensure that your commit messages increment the version using [GitVersion syntax](https://gitversion.readthedocs.io/en/latest/input/docs/more-info/version-increments/). If no message is found then the patch version will be incremented by default.
1. You may merge the pull request once it meets all of the required checks. If you do not have permision, a reviewer will do it for you
1 change: 1 addition & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mode: mainline
36 changes: 24 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: $(GITVERSION_FullSemVer)
trigger:
batch: true
branches:
Expand All @@ -16,6 +17,17 @@ stages:
- job: BuildJob
displayName: Build
steps:
- task: gitversion/setup@0
displayName: Install GitVersion
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
displayName: Execute GitVersion
inputs:
useConfigFile: true
configFilePath: '$(Build.SourcesDirectory)\GitVersion.yml'
updateAssemblyInfo: true
updateAssemblyInfoFilename: '$(Build.SourcesDirectory)\bindings\src\Capgemini.PowerApps.SpecFlowBindings\Properties\AssemblyInfo.cs'
- task: NuGetToolInstaller@1
displayName: Install NuGet
- task: NuGetCommand@2
Expand All @@ -38,9 +50,11 @@ stages:
inputs:
command: pack
packagesToPack: bindings\src\Capgemini.PowerApps.SpecFlowBindings\Capgemini.PowerApps.SpecFlowBindings.csproj
includeReferencedProjects: true
includeReferencedProjects: false
packDestination: '$(Build.ArtifactStagingDirectory)/out'
configuration: $(buildConfiguration)
versioningScheme: byEnvVar
versionEnvVar: 'GitVersion.NuGetVersionV2'
- publish: $(Build.ArtifactStagingDirectory)/out
displayName: Publish NuGet artifact
artifact: Capgemini.PowerApps.SpecFlowBindings
Expand All @@ -50,8 +64,8 @@ stages:
- publish: bindings\tests\Capgemini.PowerApps.SpecFlowBindings.UiTests\bin\$(buildConfiguration)
displayName: Publish tests
artifact: tests
- stage: UnitTest
displayName: Unit test
- stage: Test
displayName: Test
dependsOn: Build
jobs:
- job: UnitTestJob
Expand Down Expand Up @@ -80,10 +94,6 @@ stages:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Pipeline.Workspace)/driver/coverage/cobertura/cobertura.xml'
reportDirectory: '$(Pipeline.Workspace)/driver/coverage/html'
- stage: UiTest
displayName: UI Test
dependsOn: Build
jobs:
- job: UiTestJob
displayName: UI Test
variables:
Expand All @@ -98,6 +108,8 @@ stages:
inputs:
uiTests: true
runInParallel: true
codeCoverageEnabled: true
runSettingsFile: $(Pipeline.Workspace)\tests\CodeCoverage.runsettings
testAssemblyVer2: |
**\*UiTests.dll
!**\*TestAdapter.dll
Expand All @@ -108,11 +120,11 @@ stages:
POWERAPPS_SPECFLOW_BINDINGS_TEST_ADMIN_USERNAME: $(User ADO Integration Username)
POWERAPPS_SPECFLOW_BINDINGS_TEST_ADMIN_PASSWORD: $(User ADO Integration Password)
POWERAPPS_SPECFLOW_BINDINGS_TEST_URL: $(URL)
- stage: PublishPackage
displayName: Publish Package
- stage: Publish
displayName: Publish
jobs:
- job: PublishToNuGetGalleryJob
displayName: Publish To NuGet Gallery
- job: PublishJob
displayName: Publish
steps:
- checkout: none
- download: current
Expand All @@ -124,4 +136,4 @@ stages:
command: push
packagesToPush: '$(Pipeline.Workspace)/Capgemini.PowerApps.SpecFlowBindings/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: NuGet
publishFeedCredentials: Capgemini_UK
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>Capgemini.PowerApps.SpecFlowBindings</id>
<title>Power Apps SpecFlow Bindings</title>
<icon>images\icon.png</icon>
<version>0.7.1-alpha</version>
<version>0.1.0</version>
<description>A SpecFlow bindings library for Power Apps.</description>
<authors>Capgemini_UK, ewingjm</authors>
<owners>Capgemini_UK, ewingjm</owners>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations for data collectors -->
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<CodeCoverage>
<ModulePaths>
<Include>
<ModulePath>Capgemini.PowerApps.SpecFlowBindings.dll</ModulePath>
</Include>
</ModulePaths>
</CodeCoverage>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>

0 comments on commit f850f9d

Please sign in to comment.