Skip to content

Commit

Permalink
Add CI Files and Checks #62
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser Greenroyd authored and adecler committed Jan 29, 2020
1 parent 9bd9383 commit d8cb2bc
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .ci/CloneTest.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Param([string]$repo)

# **** Cloning BHoM Test_Toolkit ****
$repo = "Test_Toolkit"

# **** Defining Paths ****
$slnPath = "$ENV:BUILD_SOURCESDIRECTORY\$repo\$repo.sln"

# **** Cloning Repo ****
Write-Output ("Cloning " + $repo + " to " + $ENV:BUILD_SOURCESDIRECTORY + "\" + $repo)
git clone -q --branch=master https://github.com/BHoM/$repo.git $ENV:BUILD_SOURCESDIRECTORY\$repo

# **** Restore NuGet ****
Write-Output ("Restoring NuGet packages for " + $repo)
& NuGet.exe restore $slnPath
65 changes: 65 additions & 0 deletions .ci/check-all-depandants.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
vmImage: 'vs2017-win2016'

variables:
solution: '**/Socket_Toolkit.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
projectName: 'Socket_Toolkit'

steps:
- checkout: self
persistCredentials: true

- task: CopyFiles@2
displayName: 'Move Cloned Files to Correct Toolkit Folder'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**'
TargetFolder: '$(Build.SourcesDirectory)/$(projectName)'

- task: DeleteFiles@1
displayName: 'Clean Up After Moving Cloned Files'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**.sln'

- task: NuGetToolInstaller@1

- task: PowerShell@2
displayName: 'Clone Test Toolkit'
inputs:
filePath: '.ci/CloneTest.ps1'

- task: PowerShell@2
displayName: 'Clone and Build Dependencies'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1'

- task: NuGetCommand@2
displayName: 'Restore NuGets for Primary Solution'
inputs:
restoreSolution: '$(solution)'

- task: PowerShell@2
displayName: 'Build Primary Solution'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildPrimarySolution.ps1'

- task: PowerShell@2
displayName: 'Clone and Build Core Dependencies'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildCore.ps1'

- task: PowerShell@2
displayName: 'Clone and Build all Dependencies'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1'
60 changes: 60 additions & 0 deletions .ci/check-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
vmImage: 'vs2017-win2016'

variables:
solution: '**/Socket_Toolkit.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
projectName: 'Socket_Toolkit'

steps:
- checkout: self
persistCredentials: true

- task: CopyFiles@2
displayName: 'Move Cloned Files to Correct Toolkit Folder'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**'
TargetFolder: '$(Build.SourcesDirectory)/$(projectName)'

- task: DeleteFiles@1
displayName: 'Clean Up After Moving Cloned Files'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**.sln'

- task: NuGetToolInstaller@1

- task: PowerShell@2
displayName: 'Clone Test Toolkit'
inputs:
filePath: '.ci/CloneTest.ps1'

- task: PowerShell@2
displayName: 'Clone and Build Dependencies'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1'

- task: NuGetCommand@2
displayName: 'Restore NuGets for Primary Solution'
inputs:
restoreSolution: '$(solution)'

- task: PowerShell@2
displayName: 'Build Primary Solution'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildPrimarySolution.ps1'

- task: PowerShell@2
displayName: 'Clone and Build Core Dependencies'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildCore.ps1'
43 changes: 43 additions & 0 deletions .ci/check-installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
vmImage: 'vs2017-win2016'

variables:
solution: '**/Socket_Toolkit.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
projectName: 'Socket_Toolkit'

steps:
- checkout: self
persistCredentials: true

- task: DeleteFiles@1
displayName: 'Clean Up After Moving Cloned Files'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**.sln'

- task: NuGetToolInstaller@1

- task: PowerShell@2
displayName: 'Clone Test Toolkit'
inputs:
filePath: '.ci/CloneTest.ps1'

- task: PowerShell@2
displayName: 'Clone BHoM_Installer'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneInstaller.ps1'

- task: PowerShell@2
displayName: 'Run BHoM_Installer tasks'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildInstaller.ps1'
61 changes: 61 additions & 0 deletions .ci/run-compliance-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
vmImage: 'vs2017-win2016'

variables:
solution: '**/Socket_Toolkit.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
projectName: 'Socket_Toolkit'

steps:
- checkout: self
persistCredentials: true

- task: CopyFiles@2
displayName: 'Move Cloned Files to Correct Toolkit Folder'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**'
TargetFolder: '$(Build.SourcesDirectory)/$(projectName)'

- task: DeleteFiles@1
displayName: 'Clean Up After Moving Cloned Files'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**.sln'

- task: NuGetToolInstaller@1

- task: PowerShell@2
displayName: 'Clone Test Toolkit'
inputs:
filePath: '.ci/CloneTest.ps1'

- task: PowerShell@2
displayName: 'Clone and Build Dependencies'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/CloneAndBuildDependencies.ps1'

- task: PowerShell@2
displayName: 'Build Test Toolkit'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/BuildTest.ps1'

- task: PowerShell@2
displayName: 'Copy changed files'
inputs:
filePath: '$(Build.SourcesDirectory)/Test_Toolkit/MovePRFiles.ps1'

- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: '$(Build.SourcesDirectory)/Test_Toolkit/Build/CodeComplianceTest_Test.dll'
runSettingsFile: '.ci/testSettings.runsettings'
66 changes: 66 additions & 0 deletions .ci/testSettings.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
<!-- Path relative to solution directory -->
<ResultsDirectory>..\TestResults</ResultsDirectory>

<!-- [x86] | x64
- You can also change it from menu Test, Test Settings, Default Processor Architecture -->
<TargetPlatform>x86</TargetPlatform>

<!-- Framework35 | [Framework40] | Framework45 -->
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>

<!-- Path to Test Adapters -->
<!--<TestAdaptersPaths>%SystemDrive%\Temp\foo;%SystemDrive%\Temp\bar</TestAdaptersPaths>-->
</RunConfiguration>

<!-- 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>
<Exclude>
<ModulePath>.*CPPUnitTestFramework.*</ModulePath>
</Exclude>
</ModulePaths>

<!-- We recommend you do not change the following values: -->
<UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
<CollectFromChildProcesses>True</CollectFromChildProcesses>
<CollectAspDotNet>False</CollectAspDotNet>

</CodeCoverage>
</Configuration>
</DataCollector>

</DataCollectors>
</DataCollectionRunSettings>

<!-- Parameters used by tests at runtime -->
<TestRunParameters>
<Parameter name="projectName" value="Socket_Toolkit" />
<Parameter name="oMName" value="null" />
<Parameter name="engineName" value="null" />
<Parameter name="adapterName" value="null" />
</TestRunParameters>

<!-- Adapter Specific sections -->

<!-- MSTest adapter -->
<MSTest>
<MapInconclusiveToFailed>True</MapInconclusiveToFailed>
<CaptureTraceOutput>false</CaptureTraceOutput>
<DeleteDeploymentDirectoryAfterTestRunIsComplete>False</DeleteDeploymentDirectoryAfterTestRunIsComplete>
<DeploymentEnabled>False</DeploymentEnabled>
<AssemblyResolution>
<Directory path="D:\myfolder\bin\" includeSubDirectories="false"/>
</AssemblyResolution>
</MSTest>

</RunSettings>
Empty file added core.txt
Empty file.
Empty file added dependants.txt
Empty file.
3 changes: 3 additions & 0 deletions dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BHoM/BHoM
BHoM/BHoM_Engine
BHoM/BHoM_Adapter

0 comments on commit d8cb2bc

Please sign in to comment.