|
| 1 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +# Licensed under the MIT License. |
| 3 | +# https://aka.ms/yaml |
| 4 | + |
| 5 | +parameters: |
| 6 | + - name: Sign |
| 7 | + type: boolean |
| 8 | + default: false |
| 9 | + - name: Integration |
| 10 | + type: boolean |
| 11 | + default: false |
| 12 | + |
| 13 | +steps: |
| 14 | +- task: powershell@2 |
| 15 | + displayName: 'Show current PowerShell version information' |
| 16 | + inputs: |
| 17 | + targetType: inline |
| 18 | + script: 'echo $PSVersionTable' |
| 19 | + pwsh: true |
| 20 | +- task: powershell@2 |
| 21 | + displayName: 'Set maximum function count' |
| 22 | + inputs: |
| 23 | + targetType: inline |
| 24 | + script: '$MaximumFunctionCount=32768' |
| 25 | + pwsh: true |
| 26 | +- task: powershell@2 |
| 27 | + displayName: 'Install Dependencies Entra' |
| 28 | + inputs: |
| 29 | + targetType: inline |
| 30 | + script: | |
| 31 | + ./build/Install-Dependencies.ps1 -ModuleName Entra -Verbose |
| 32 | + pwsh: true |
| 33 | +- task: powershell@2 |
| 34 | + displayName: 'Install PlatyPS' |
| 35 | + inputs: |
| 36 | + targetType: inline |
| 37 | + script: Install-Module PlatyPS -scope currentuser -Force |
| 38 | + pwsh: true |
| 39 | +# - task: powershell@2 |
| 40 | +# displayName: 'Create Module Help Files Entra' |
| 41 | +# inputs: |
| 42 | +# targetType: inline |
| 43 | +# script: | |
| 44 | +# Import-Module PlatyPS |
| 45 | +# . ./build/common-functions.ps1 |
| 46 | +# Create-ModuleHelp -Module Entra |
| 47 | +# pwsh: true |
| 48 | +- task: powershell@2 |
| 49 | + displayName: '[Modularization ] Build Entra' |
| 50 | + inputs: |
| 51 | + targetType: inline |
| 52 | + script: | |
| 53 | + ./build/Create-EntraModule.ps1 -Module Entra -Verbose |
| 54 | + ./build/Create-EntraModule.ps1 -Module Entra -Root -Verbose |
| 55 | + pwsh: true |
| 56 | +- ${{ if eq(parameters.Sign, true) }}: |
| 57 | + - template: ../common-templates/esrp/codesign-migrate.yml |
| 58 | + parameters: |
| 59 | + FolderPath: "bin" |
| 60 | + Pattern: "*.psm1, *.psd1, *.format.ps1xml, *.ps1" |
| 61 | + - task: PowerShell@2 |
| 62 | + displayName: "Validate Authenticode Signature" |
| 63 | + inputs: |
| 64 | + targetType: "inline" |
| 65 | + pwsh: true |
| 66 | + script: ./build/ValidateAuthenticodeSignature.ps1 |
| 67 | +- task: powershell@2 |
| 68 | + displayName: 'Create Module Files Entra' |
| 69 | + inputs: |
| 70 | + targetType: inline |
| 71 | + script: | |
| 72 | + . ./build/common-functions.ps1 |
| 73 | + Create-ModuleFolder |
| 74 | + pwsh: true |
| 75 | +- task: 1ES.PublishBuildArtifacts@1 |
| 76 | + displayName: 'Publish Module Files EntraBeta' |
| 77 | + inputs: |
| 78 | + PathtoPublish: 'bin' |
| 79 | + ArtifactName: 'Module Files' |
| 80 | +- task: powershell@2 |
| 81 | + displayName: 'Register Local Gallery' |
| 82 | + inputs: |
| 83 | + targetType: inline |
| 84 | + script: | |
| 85 | + . ./build/common-functions.ps1 |
| 86 | + Register-LocalGallery -Path $(Build.ArtifactStagingDirectory) |
| 87 | + pwsh: true |
| 88 | +- task: powershell@2 |
| 89 | + displayName: 'Publish to Local Gallery Entra' |
| 90 | + inputs: |
| 91 | + targetType: inline |
| 92 | + script: ./build/Publish-LocalCompatModule.ps1 -Install |
| 93 | + pwsh: true |
| 94 | +- task: 1ES.PublishBuildArtifacts@1 |
| 95 | + displayName: 'Publish Module Nuget File Entra' |
| 96 | + inputs: |
| 97 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)' |
| 98 | + ArtifactName: 'Module Nuget' |
| 99 | +- task: powershell@2 |
| 100 | + displayName: 'Remove Build Folders' |
| 101 | + inputs: |
| 102 | + targetType: inline |
| 103 | + script: | |
| 104 | + . ./build/common-functions.ps1 |
| 105 | + Remove-BuildDirectories |
| 106 | + pwsh: true |
| 107 | +- task: powershell@2 |
| 108 | + displayName: 'Install Dependencies EntraBeta' |
| 109 | + inputs: |
| 110 | + targetType: inline |
| 111 | + script: | |
| 112 | + ./build/Install-Dependencies.ps1 -ModuleName EntraBeta -Verbose |
| 113 | + pwsh: true |
| 114 | +# - task: powershell@2 |
| 115 | +# displayName: 'Create Module Help Files EntraBeta' |
| 116 | +# inputs: |
| 117 | +# targetType: inline |
| 118 | +# script: | |
| 119 | +# Import-Module PlatyPS |
| 120 | +# . ./build/common-functions.ps1 |
| 121 | +# Create-ModuleHelp -Module EntraBeta |
| 122 | +# pwsh: true |
| 123 | +- task: powershell@2 |
| 124 | + displayName: '[Modularization ] Build EntraBeta' |
| 125 | + inputs: |
| 126 | + targetType: inline |
| 127 | + script: | |
| 128 | + ./build/Create-EntraModule.ps1 -Module EntraBeta -Verbose |
| 129 | + ./build/Create-EntraModule.ps1 -Module EntraBeta -Root -Verbose |
| 130 | + pwsh: true |
| 131 | +- ${{ if eq(parameters.Sign, true) }}: |
| 132 | + - template: ../common-templates/esrp/codesign-migrate.yml |
| 133 | + parameters: |
| 134 | + FolderPath: "bin" |
| 135 | + Pattern: "*.psm1, *.psd1, *.format.ps1xml, *.ps1" |
| 136 | + - task: PowerShell@2 |
| 137 | + displayName: "Validate Authenticode Signature" |
| 138 | + inputs: |
| 139 | + targetType: "inline" |
| 140 | + pwsh: true |
| 141 | + script: ./build/ValidateAuthenticodeSignature.ps1 |
| 142 | +- task: powershell@2 |
| 143 | + displayName: 'Create Module Files EntraBeta' |
| 144 | + inputs: |
| 145 | + targetType: inline |
| 146 | + script: | |
| 147 | + . ./build/common-functions.ps1 |
| 148 | + Create-ModuleFolder |
| 149 | + pwsh: true |
| 150 | +- task: 1ES.PublishBuildArtifacts@1 |
| 151 | + displayName: 'Publish Module Files EntraBeta' |
| 152 | + inputs: |
| 153 | + PathtoPublish: 'bin' |
| 154 | + ArtifactName: 'Module Files' |
| 155 | +- task: powershell@2 |
| 156 | + displayName: 'Publish to Local Gallery EntraBeta' |
| 157 | + inputs: |
| 158 | + targetType: inline |
| 159 | + script: ./build/Publish-LocalCompatModule.ps1 -Install |
| 160 | + pwsh: true |
| 161 | +- task: 1ES.PublishBuildArtifacts@1 |
| 162 | + displayName: 'Publish Module Nuget File EntraBeta' |
| 163 | + inputs: |
| 164 | + PathtoPublish: '$(Build.ArtifactStagingDirectory)' |
| 165 | + ArtifactName: 'Module Nuget' |
| 166 | +- task: powershell@2 |
| 167 | + displayName: 'Remove Build Folders' |
| 168 | + inputs: |
| 169 | + targetType: inline |
| 170 | + script: | |
| 171 | + . ./build/common-functions.ps1 |
| 172 | + Remove-BuildDirectories |
| 173 | + pwsh: true |
| 174 | +- task: powershell@2 |
| 175 | + displayName: 'Install Pester' |
| 176 | + inputs: |
| 177 | + targetType: inline |
| 178 | + script: Install-Module Pester -scope currentuser -SkipPublisherCheck -Force |
| 179 | + pwsh: true |
| 180 | +- task: powershell@2 |
| 181 | + displayName: 'Run tests Entra' |
| 182 | + inputs: |
| 183 | + targetType: inline |
| 184 | + pwsh: true |
| 185 | + script: | |
| 186 | + cd test/Entra |
| 187 | + Invoke-Pester -OutputFile "./test/results/pester-test-results-ad.xml" -OutputFormat NUnitXml |
| 188 | +- task: PublishTestResults@2 |
| 189 | + inputs: |
| 190 | + testResultsFormat: NUnit |
| 191 | + testResultsFiles: "./test/results/pester-test-results-ad.xml" |
| 192 | + failTaskOnFailedTests: true |
| 193 | +- task: powershell@2 |
| 194 | + displayName: 'Run tests Entra Beta' |
| 195 | + inputs: |
| 196 | + targetType: inline |
| 197 | + pwsh: true |
| 198 | + script: | |
| 199 | + cd test/EntraBeta |
| 200 | + Invoke-Pester -OutputFile "./test/results/pester-test-results-ad.xml" -OutputFormat NUnitXml |
| 201 | +- task: PublishTestResults@2 |
| 202 | + inputs: |
| 203 | + testResultsFormat: NUnit |
| 204 | + testResultsFiles: "./test/results/pester-test-results-ad.xml" |
| 205 | + failTaskOnFailedTests: true |
| 206 | +- ${{ if eq(parameters.Integration, true) }}: |
| 207 | + - task: powershell@2 |
| 208 | + displayName: 'Run Entra integration tests' |
| 209 | + inputs: |
| 210 | + targetType: inline |
| 211 | + pwsh: true |
| 212 | + script: | |
| 213 | + cd test/module/Integration/Entra |
| 214 | + Invoke-Pester -OutputFile "./test/results/pester-test-results-preview.xml" -OutputFormat NUnitXml |
| 215 | + - task: PublishTestResults@2 |
| 216 | + inputs: |
| 217 | + testResultsFormat: NUnit |
| 218 | + testResultsFiles: "./test/results/pester-test-results-preview.xml" |
| 219 | + failTaskOnFailedTests: true |
| 220 | + - task: powershell@2 |
| 221 | + displayName: 'Run EntraBeta integration tests' |
| 222 | + inputs: |
| 223 | + targetType: inline |
| 224 | + pwsh: true |
| 225 | + script: | |
| 226 | + cd test/module/Integration/EntraBeta |
| 227 | + Invoke-Pester -OutputFile "./test/results/pester-test-results-preview.xml" -OutputFormat NUnitXml |
| 228 | + - task: PublishTestResults@2 |
| 229 | + inputs: |
| 230 | + testResultsFormat: NUnit |
| 231 | + testResultsFiles: "./test/results/pester-test-results-preview.xml" |
| 232 | + failTaskOnFailedTests: true |
| 233 | +- task: powershell@2 |
| 234 | + displayName: 'Remove Local Gallery' |
| 235 | + inputs: |
| 236 | + targetType: inline |
| 237 | + script: | |
| 238 | + . ./build/common-functions.ps1 |
| 239 | + Unregister-LocalGallery |
| 240 | + pwsh: true |
| 241 | +- task: PSScriptAnalyzer@1 |
| 242 | + displayName: 'Run PSScriptAnalyzer' |
| 243 | + inputs: |
| 244 | + Path: '$(Build.SourcesDirectory)' |
| 245 | + Settings: required |
| 246 | + IgnorePattern: .gdn |
| 247 | + Recurse: true |
0 commit comments