Skip to content

ADO changes to follow guidelines #8966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d832046
Removed build folder. Moving yaml files to follow guidelines.
MiYanni Apr 5, 2019
f1d1149
Moved steps files into util.
MiYanni Apr 6, 2019
3041699
Added ADO v2 pipeline. Updated build.proj to use consistent path vari…
MiYanni Apr 6, 2019
28c7b3b
Attempting to fix variable replacement.
MiYanni Apr 6, 2019
109fba6
Fix for matrix defined variables.
MiYanni Apr 6, 2019
413eba0
Fixed variable names to follow standards. Removed necessity to define…
MiYanni Apr 6, 2019
b920f4f
Resolving template variables needs verbose syntax.
MiYanni Apr 6, 2019
61bcd83
More tests with variable passing.
MiYanni Apr 6, 2019
a88ff73
Changing matrix variable name.
MiYanni Apr 6, 2019
33fb710
Removed install-pwsh-steps.yml since it is no longer needed.
MiYanni Apr 6, 2019
4921338
Calling powershell using name instead of exe location.
MiYanni Apr 6, 2019
eb0e35b
Made TestNet472 actually build tests so it can run tests.
MiYanni Apr 6, 2019
40adb82
Updated variable names to avoid clashing with built-in variable names.
MiYanni Apr 6, 2019
391e2b3
Added _matrix postfix to not clash with built-in variable names when …
MiYanni Apr 6, 2019
b9754eb
Matrix name definitions do not use variable resolution properly. So, …
MiYanni Apr 6, 2019
12e8634
Merge branch 'master' into ado-v2
MiYanni Apr 8, 2019
e23f335
Space fix to make new commit to kick CI.
MiYanni Apr 8, 2019
5dac1a0
Text change to trigger CI.
MiYanni Apr 8, 2019
0059848
Changed pipeline names to match scenario intent instead of test frame…
MiYanni Apr 9, 2019
a2a5e56
Updated matrix variable casing.
MiYanni Apr 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .azure-pipelines/powershell-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
variables:
WindowsName: windows
WindowsImage: VS2017-Win2016
LinuxName: linux
LinuxImage: Ubuntu-16.04
MacOSName: macOS
MacOSImage: macOS-10.13
TestFramework: netcoreapp2.1
TestTarget: Test
Configuration: Debug

jobs:
- job: Build
displayName: Build
condition: succeeded()
strategy:
matrix:
windows:
OSName: ${{ variables.WindowsName }}
ImageName: ${{ variables.WindowsImage }}
linux:
OSName: ${{ variables.LinuxName }}
ImageName: ${{ variables.LinuxImage }}
macOS:
OSName: ${{ variables.MacOSName }}
ImageName: ${{ variables.MacOSImage }}
pool:
vmImage: $(ImageName)

steps:
- template: util/build-steps.yml
parameters:
osName: $(OSName)
testFramework: ${{ variables.TestFramework }}
configuration: ${{ variables.Configuration }}

- job: Analyze
displayName: Analyze
dependsOn: Build
condition: succeeded()
strategy:
matrix:
windows:
OSName: ${{ variables.WindowsName }}
ImageName: ${{ variables.WindowsImage }}
linux:
OSName: ${{ variables.LinuxName }}
ImageName: ${{ variables.LinuxImage }}
macOS:
OSName: ${{ variables.MacOSName }}
ImageName: ${{ variables.MacOSImage }}
pool:
vmImage: $(ImageName)

steps:
- template: util/analyze-steps.yml
parameters:
osName: $(OSName)
configuration: ${{ variables.Configuration }}

- job: Test
displayName: Test
dependsOn: Build
condition: succeeded()
timeoutInMinutes: 120
strategy:
matrix:
windows:
OSName: ${{ variables.WindowsName }}
ImageName: ${{ variables.WindowsImage }}
linux:
OSName: ${{ variables.LinuxName }}
ImageName: ${{ variables.LinuxImage }}
macOS:
OSName: ${{ variables.MacOSName }}
ImageName: ${{ variables.MacOSImage }}
pool:
vmImage: $(ImageName)

steps:
- template: util/test-steps.yml
parameters:
osName: $(OSName)
testFramework: ${{ variables.TestFramework }}
testTarget: ${{ variables.TestTarget }}
configuration: ${{ variables.Configuration }}
29 changes: 29 additions & 0 deletions .azure-pipelines/util/analyze-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
parameters:
osName: ''
configuration: ''

steps:
- template: download-build-steps.yml
parameters:
osName: ${{ parameters.osName }}

- pwsh: 'Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser'
displayName: 'Install platyPS'

- task: DotNetCoreCLI@2
displayName: 'Generate Help'
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:GenerateHelp /p:Configuration=${{ parameters.configuration }}'

- task: DotNetCoreCLI@2
displayName: 'Static Analysis'
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }}'

- template: publish-artifacts-steps.yml
parameters:
artifactName: analyze-${{ parameters.osName }}
16 changes: 16 additions & 0 deletions .azure-pipelines/util/build-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
parameters:
osName: ''
testFramework: ''
configuration: ''

steps:
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:Build /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }}'

- template: publish-artifacts-steps.yml
parameters:
artifactName: build-${{ parameters.osName }}
9 changes: 9 additions & 0 deletions .azure-pipelines/util/download-build-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
parameters:
osName: ''

steps:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a number of these templates can be folded into the one yaml file to avoid some levels of complexity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are reused between different jobs in different pipelines, it makes sense to have a separate template. The primary issue is that you cannot template a job matrix. Meaning, I can't make a job template where a strategy is conditionally defined.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is one of the limitations of the templates. However I don't think that would be necessary if you had one matrix strategy for both and just control the framework as one of the matrix variables.

- task: DownloadPipelineArtifact@0
displayName: 'Download build-${{ parameters.osName }}'
inputs:
artifactName: build-${{ parameters.osName }}
targetPath: artifacts
21 changes: 21 additions & 0 deletions .azure-pipelines/util/test-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
parameters:
osName: ''
testFramework: ''
testTarget: ''
configuration: ''

steps:
- template: download-build-steps.yml
parameters:
osName: ${{ parameters.osName }}

- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }}'

- template: publish-artifacts-steps.yml
parameters:
artifactName: test-${{ parameters.osName }}
36 changes: 36 additions & 0 deletions .azure-pipelines/windows-powershell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
variables:
WindowsName: windows
WindowsImage: VS2017-Win2016
TestFramework: net472
TestTarget: TestNet472
Configuration: Debug

jobs:
- job: Build
displayName: Build
condition: succeeded()
pool:
vmImage: ${{ variables.WindowsImage }}

steps:
- template: util/build-steps.yml
parameters:
osName: ${{ variables.WindowsName }}
testFramework: ${{ variables.TestFramework }}
configuration: ${{ variables.Configuration }}

- job: Test
displayName: Test
dependsOn: Build
condition: succeeded()
timeoutInMinutes: 120
pool:
vmImage: ${{ variables.WindowsImage }}

steps:
- template: util/test-steps.yml
parameters:
osName: ${{ variables.WindowsName }}
testFramework: ${{ variables.TestFramework }}
testTarget: ${{ variables.TestTarget }}
configuration: ${{ variables.Configuration }}
1 change: 0 additions & 1 deletion Repo.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<RepoSrc>$(RepoRoot)src/</RepoSrc>
<RepoArtifacts>$(RepoRoot)artifacts/</RepoArtifacts>
<RepoTools>$(RepoRoot)tools/</RepoTools>
<RepoBuild>$(RepoRoot)build/</RepoBuild>
</PropertyGroup>

</Project>
8 changes: 0 additions & 8 deletions azure-powershell-linux.yml

This file was deleted.

8 changes: 0 additions & 8 deletions azure-powershell-macOS.yml

This file was deleted.

8 changes: 0 additions & 8 deletions azure-powershell-windows.yml

This file was deleted.

Loading