From d8cb2bc40f874abeef0afaf5412dc1d559803cc6 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Tue, 28 Jan 2020 11:13:42 +0000 Subject: [PATCH] Add CI Files and Checks #62 --- .ci/CloneTest.ps1 | 15 ++++++++ .ci/check-all-depandants.yml | 65 +++++++++++++++++++++++++++++++++++ .ci/check-core.yml | 60 ++++++++++++++++++++++++++++++++ .ci/check-installer.yml | 43 +++++++++++++++++++++++ .ci/run-compliance-tests.yml | 61 +++++++++++++++++++++++++++++++++ .ci/testSettings.runsettings | 66 ++++++++++++++++++++++++++++++++++++ core.txt | 0 dependants.txt | 0 dependencies.txt | 3 ++ 9 files changed, 313 insertions(+) create mode 100644 .ci/CloneTest.ps1 create mode 100644 .ci/check-all-depandants.yml create mode 100644 .ci/check-core.yml create mode 100644 .ci/check-installer.yml create mode 100644 .ci/run-compliance-tests.yml create mode 100644 .ci/testSettings.runsettings create mode 100644 core.txt create mode 100644 dependants.txt create mode 100644 dependencies.txt diff --git a/.ci/CloneTest.ps1 b/.ci/CloneTest.ps1 new file mode 100644 index 0000000..8cfd3e1 --- /dev/null +++ b/.ci/CloneTest.ps1 @@ -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 \ No newline at end of file diff --git a/.ci/check-all-depandants.yml b/.ci/check-all-depandants.yml new file mode 100644 index 0000000..ed426dc --- /dev/null +++ b/.ci/check-all-depandants.yml @@ -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' \ No newline at end of file diff --git a/.ci/check-core.yml b/.ci/check-core.yml new file mode 100644 index 0000000..6a73b9a --- /dev/null +++ b/.ci/check-core.yml @@ -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' \ No newline at end of file diff --git a/.ci/check-installer.yml b/.ci/check-installer.yml new file mode 100644 index 0000000..512322e --- /dev/null +++ b/.ci/check-installer.yml @@ -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' \ No newline at end of file diff --git a/.ci/run-compliance-tests.yml b/.ci/run-compliance-tests.yml new file mode 100644 index 0000000..3b20daa --- /dev/null +++ b/.ci/run-compliance-tests.yml @@ -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' \ No newline at end of file diff --git a/.ci/testSettings.runsettings b/.ci/testSettings.runsettings new file mode 100644 index 0000000..bd04369 --- /dev/null +++ b/.ci/testSettings.runsettings @@ -0,0 +1,66 @@ + + + + + 1 + + ..\TestResults + + + x86 + + + Framework40 + + + + + + + + + + + + + + .*CPPUnitTestFramework.* + + + + + True + True + True + False + + + + + + + + + + + + + + + + + + + + + True + false + False + False + + + + + + \ No newline at end of file diff --git a/core.txt b/core.txt new file mode 100644 index 0000000..e69de29 diff --git a/dependants.txt b/dependants.txt new file mode 100644 index 0000000..e69de29 diff --git a/dependencies.txt b/dependencies.txt new file mode 100644 index 0000000..c859174 --- /dev/null +++ b/dependencies.txt @@ -0,0 +1,3 @@ +BHoM/BHoM +BHoM/BHoM_Engine +BHoM/BHoM_Adapter \ No newline at end of file