Skip to content

Commit 7e83d2c

Browse files
authored
Merge branch 'microsoftgraph:main' into se-Build-Install-Dependencies
2 parents 0f74281 + 48b48fa commit 7e83d2c

1,029 files changed

Lines changed: 42009 additions & 7479 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
4+
trigger:
5+
branches:
6+
include:
7+
- main
8+
pr: none
9+
parameters:
10+
- name: Pack
11+
type: boolean
12+
default: true
13+
- name: Sign
14+
type: boolean
15+
default: true
16+
resources:
17+
repositories:
18+
- repository: 1ESPipelineTemplates
19+
type: git
20+
name: 1ESPipelineTemplates/1ESPipelineTemplates
21+
ref: refs/heads/main
22+
23+
extends:
24+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
25+
parameters:
26+
pool:
27+
name: MSSecurity-1ES-Build-Agents-Pool
28+
image: MSSecurity-1ES-Windows-2022
29+
os: windows
30+
sdl:
31+
sourceAnalysisPool:
32+
name: MSSecurity-1ES-Build-Agents-Pool
33+
image: MSSecurity-1ES-Windows-2022
34+
os: windows
35+
stages:
36+
- stage: build
37+
jobs:
38+
- job: EntraPowerShellCIBuild
39+
displayName: Entra PowerShell CI Build
40+
timeoutInMinutes: 840
41+
steps:
42+
- template: .azure-pipelines/common-templates/install-tools.yml@self
43+
- template: .azure-pipelines/common-templates/security-pre-checks.yml@self
44+
45+
- template: .azure-pipelines/generation-templates/generate_adapter-migrate-1es.yml@self
46+
parameters:
47+
Sign: ${{ parameters.Sign }}
48+
49+
- ${{ if and(eq(parameters.Pack, true), eq(parameters.Sign, true)) }}:
50+
- template: .azure-pipelines/common-templates/esrp/codesign-nuget-migrate.yml@self
51+
parameters:
52+
FolderPath: "$(Build.ArtifactStagingDirectory)"
53+
Pattern: "Microsoft.Graph.Entra.*.nupkg"
54+
- task: 1ES.PublishBuildArtifacts@1
55+
displayName: Publish Module Artifacts
56+
inputs:
57+
PathtoPublish: $(Build.ArtifactStagingDirectory)
58+
ArtifactName: drop
59+
- task: 1ES.PublishNuget@1
60+
displayName: Publish NuGet to preview feed
61+
inputs:
62+
useDotNetTask: false
63+
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Graph.Entra.*.nupkg
64+
packageParentPath: '$(Build.ArtifactStagingDirectory)'
65+
publishVstsFeed: $(PROJECT_NAME)/$(PREVIEW_FEED_NAME)
66+
nuGetFeedType: internal
67+
allowPackageConflicts: true
68+
69+
- template: .azure-pipelines/common-templates/security-post-checks.yml@self
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
4+
trigger: none
5+
pr: none
6+
7+
resources:
8+
pipelines:
9+
- pipeline: _1es-EntraPowerShell-CI
10+
source: 1es-EntraPowerShell-CI
11+
repositories:
12+
- repository: 1ESPipelineTemplates
13+
type: git
14+
name: 1ESPipelineTemplates/1ESPipelineTemplates
15+
ref: refs/heads/main
16+
17+
extends:
18+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
19+
parameters:
20+
pool:
21+
name: MSSecurity-1ES-Build-Agents-Pool
22+
image: MSSecurity-1ES-Windows-2022
23+
os: windows
24+
sdl:
25+
sourceAnalysisPool:
26+
name: MSSecurity-1ES-Build-Agents-Pool
27+
image: MSSecurity-1ES-Windows-2022
28+
os: windows
29+
stages:
30+
- stage: release
31+
jobs:
32+
- job: approval
33+
displayName: Approval
34+
pool: server
35+
timeoutInMinutes: 720
36+
steps:
37+
- task: ApprovalTask@1
38+
inputs:
39+
environment: Production
40+
servicetreeguid: f3970205-d841-45de-8b2d-3a7d45846ae1
41+
42+
- job: release
43+
dependsOn: approval
44+
condition: succeeded('approval')
45+
templateContext:
46+
type: releaseJob
47+
isProduction: true
48+
inputs:
49+
- input: pipelineArtifact
50+
pipeline: _1es-EntraPowerShell-CI
51+
artifactName: drop
52+
targetPath: $(Build.ArtifactStagingDirectory)/drop
53+
steps:
54+
- task: 1ES.PublishNuget@1
55+
displayName: Publish Nuget package
56+
inputs:
57+
useDotNetTask: false
58+
packagesToPush: '$(Build.ArtifactStagingDirectory)/drop/Microsoft.Graph.Entra*.nupkg'
59+
packageParentPath: '$(Build.ArtifactStagingDirectory)'
60+
nuGetFeedType: external
61+
allowPackageConflicts: true
62+
publishPackageMetadata: true
63+
publishFeedCredentials: EntraPowerShell_PSGallery

.azure-pipelines/ci-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
44
parameters:
55
- name: BuildAgent
6-
default: 1es-windows-ps-compute
6+
default: 1es-windows-ps-compute-m
77
displayName: Build Agent
88
- name: Pack
99
type: boolean
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
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: false
20+
- task: powershell@2
21+
displayName: 'Set maximum function count'
22+
inputs:
23+
targetType: inline
24+
script: '$MaximumFunctionCount=32768'
25+
pwsh: false
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: false
33+
- task: powershell@2
34+
displayName: 'Install PlatyPS'
35+
inputs:
36+
targetType: inline
37+
script: Install-Module PlatyPS -scope currentuser -Force
38+
pwsh: false
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: false
48+
- task: powershell@2
49+
displayName: 'Build Entra'
50+
inputs:
51+
targetType: inline
52+
script: ./build/Create-CompatModule.ps1 -Module Entra -Verbose
53+
pwsh: false
54+
- ${{ if eq(parameters.Sign, true) }}:
55+
- template: ../common-templates/esrp/codesign-migrate.yml
56+
parameters:
57+
FolderPath: "bin"
58+
Pattern: "*.psm1, *.psd1, *.format.ps1xml, *.ps1"
59+
- task: PowerShell@2
60+
displayName: "Validate Authenticode Signature"
61+
inputs:
62+
targetType: "inline"
63+
pwsh: true
64+
script: |
65+
$ModulePsd1 = "bin/Microsoft.Graph.Entra.psd1"
66+
$ModulePsm1 = "bin/Microsoft.Graph.Entra.psm1"
67+
($ModulePsd1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
68+
($ModulePsm1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
69+
- task: powershell@2
70+
displayName: 'Create Module Files Entra'
71+
inputs:
72+
targetType: inline
73+
script: |
74+
. ./build/common-functions.ps1
75+
Create-ModuleFolder
76+
pwsh: false
77+
- task: 1ES.PublishBuildArtifacts@1
78+
displayName: 'Publish Module Files EntraBeta'
79+
inputs:
80+
PathtoPublish: 'bin'
81+
ArtifactName: 'Module Files'
82+
- task: powershell@2
83+
displayName: 'Register Local Gallery'
84+
inputs:
85+
targetType: inline
86+
script: |
87+
. ./build/common-functions.ps1
88+
Register-LocalGallery -Path $(Build.ArtifactStagingDirectory)
89+
pwsh: false
90+
- task: powershell@2
91+
displayName: 'Publish to Local Gallery Entra'
92+
inputs:
93+
targetType: inline
94+
script: ./build/Publish-LocalCompatModule.ps1 -Install
95+
pwsh: false
96+
- task: 1ES.PublishBuildArtifacts@1
97+
displayName: 'Publish Module Nuget File Entra'
98+
inputs:
99+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
100+
ArtifactName: 'Module Nuget'
101+
- task: powershell@2
102+
displayName: 'Remove Build Folders'
103+
inputs:
104+
targetType: inline
105+
script: |
106+
. ./build/common-functions.ps1
107+
Remove-BuildDirectories
108+
pwsh: false
109+
- task: powershell@2
110+
displayName: 'Install Dependencies EntraBeta'
111+
inputs:
112+
targetType: inline
113+
script: |
114+
./build/Install-Dependencies.ps1 -ModuleName EntraBeta -Verbose
115+
pwsh: false
116+
- task: powershell@2
117+
displayName: 'Create Module Help Files EntraBeta'
118+
inputs:
119+
targetType: inline
120+
script: |
121+
Import-Module PlatyPS
122+
. ./build/common-functions.ps1
123+
Create-ModuleHelp -Module EntraBeta
124+
pwsh: false
125+
- task: powershell@2
126+
displayName: 'Build EntraBeta'
127+
inputs:
128+
targetType: inline
129+
script: |
130+
$MaximumFunctionCount=32768
131+
./build/Create-CompatModule.ps1 -Module EntraBeta -Verbose
132+
pwsh: false
133+
- ${{ if eq(parameters.Sign, true) }}:
134+
- template: ../common-templates/esrp/codesign-migrate.yml
135+
parameters:
136+
FolderPath: "bin"
137+
Pattern: "*.psm1, *.psd1, *.format.ps1xml, *.ps1"
138+
- task: PowerShell@2
139+
displayName: "Validate Authenticode Signature"
140+
inputs:
141+
targetType: "inline"
142+
pwsh: true
143+
script: |
144+
$ModulePsd1 = "bin/Microsoft.Graph.Entra.Beta.psd1"
145+
$ModulePsm1 = "bin/Microsoft.Graph.Entra.Beta.psm1"
146+
($ModulePsd1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
147+
($ModulePsm1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
148+
- task: powershell@2
149+
displayName: 'Create Module Files EntraBeta'
150+
inputs:
151+
targetType: inline
152+
script: |
153+
. ./build/common-functions.ps1
154+
Create-ModuleFolder
155+
pwsh: false
156+
- task: 1ES.PublishBuildArtifacts@1
157+
displayName: 'Publish Module Files EntraBeta'
158+
inputs:
159+
PathtoPublish: 'bin'
160+
ArtifactName: 'Module Files'
161+
- task: powershell@2
162+
displayName: 'Publish to Local Gallery EntraBeta'
163+
inputs:
164+
targetType: inline
165+
script: ./build/Publish-LocalCompatModule.ps1 -Install
166+
pwsh: false
167+
- task: 1ES.PublishBuildArtifacts@1
168+
displayName: 'Publish Module Nuget File EntraBeta'
169+
inputs:
170+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
171+
ArtifactName: 'Module Nuget'
172+
- task: powershell@2
173+
displayName: 'Remove Build Folders'
174+
inputs:
175+
targetType: inline
176+
script: |
177+
. ./build/common-functions.ps1
178+
Remove-BuildDirectories
179+
pwsh: false
180+
- task: powershell@2
181+
displayName: 'Install Pester'
182+
inputs:
183+
targetType: inline
184+
script: Install-Module Pester -scope currentuser -SkipPublisherCheck -Force
185+
pwsh: false
186+
- task: powershell@2
187+
displayName: 'Run tests Entra'
188+
inputs:
189+
targetType: inline
190+
pwsh: true
191+
script: |
192+
cd test/module/entra
193+
Invoke-Pester -OutputFile "./test/results/pester-test-results-ad.xml" -OutputFormat NUnitXml
194+
- task: PublishTestResults@2
195+
inputs:
196+
testResultsFormat: NUnit
197+
testResultsFiles: "./test/results/pester-test-results-ad.xml"
198+
failTaskOnFailedTests: true
199+
- task: powershell@2
200+
displayName: 'Run tests EntraBeta'
201+
inputs:
202+
targetType: inline
203+
pwsh: true
204+
script: |
205+
cd test/module/entrabeta
206+
Invoke-Pester -OutputFile "./test/results/pester-test-results-preview.xml" -OutputFormat NUnitXml
207+
- task: PublishTestResults@2
208+
inputs:
209+
testResultsFormat: NUnit
210+
testResultsFiles: "./test/results/pester-test-results-preview.xml"
211+
failTaskOnFailedTests: true
212+
- ${{ if eq(parameters.Integration, true) }}:
213+
- task: powershell@2
214+
displayName: 'Run Entra integration tests'
215+
inputs:
216+
targetType: inline
217+
pwsh: true
218+
script: |
219+
cd test/module/Integration/Entra
220+
Invoke-Pester -OutputFile "./test/results/pester-test-results-preview.xml" -OutputFormat NUnitXml
221+
- task: PublishTestResults@2
222+
inputs:
223+
testResultsFormat: NUnit
224+
testResultsFiles: "./test/results/pester-test-results-preview.xml"
225+
failTaskOnFailedTests: true
226+
- task: powershell@2
227+
displayName: 'Run EntraBeta integration tests'
228+
inputs:
229+
targetType: inline
230+
pwsh: true
231+
script: |
232+
cd test/module/Integration/EntraBeta
233+
Invoke-Pester -OutputFile "./test/results/pester-test-results-preview.xml" -OutputFormat NUnitXml
234+
- task: PublishTestResults@2
235+
inputs:
236+
testResultsFormat: NUnit
237+
testResultsFiles: "./test/results/pester-test-results-preview.xml"
238+
failTaskOnFailedTests: true
239+
- task: powershell@2
240+
displayName: 'Remove Local Gallery'
241+
inputs:
242+
targetType: inline
243+
script: |
244+
. ./build/common-functions.ps1
245+
Unregister-LocalGallery
246+
pwsh: false
247+
- task: PSScriptAnalyzer@1
248+
displayName: 'Run PSScriptAnalyzer'
249+
inputs:
250+
Path: '$(Build.SourcesDirectory)'
251+
Settings: required
252+
IgnorePattern: .gdn
253+
Recurse: true

0 commit comments

Comments
 (0)