Skip to content

Commit 15bf6af

Browse files
committed
add broker submodule check yaml file and add yaml to pr-validation for testing
1 parent 3170a7f commit 15bf6af

File tree

2 files changed

+287
-213
lines changed

2 files changed

+287
-213
lines changed
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Xcode
2+
# Build, test, and archive an Xcode workspace on macOS.
3+
# Add steps that install certificates, test, sign, and distribute an app, save build artifacts, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode
5+
6+
trigger:
7+
branches:
8+
include:
9+
- dev
10+
11+
pr:
12+
autoCancel: true
13+
branches:
14+
include:
15+
- '*'
16+
drafts: true
17+
18+
pool:
19+
name: 'Azure Pipelines'
20+
21+
resources:
22+
repositories:
23+
- repository: azure-activedirectory-tokenbroker-for-objc
24+
type: github
25+
endpoint: 'MSAL ObjC Service Connection'
26+
name: AzureAD/azure-activedirectory-tokenbroker-for-objc
27+
28+
- repository: WorkplaceJoin-for-iOS
29+
type: github
30+
endpoint: 'MSAL ObjC Service Connection'
31+
name: AzureAD/WorkplaceJoin-for-iOS
32+
33+
jobs:
34+
- job: 'Validate_Pull_Request'
35+
displayName: Validate Pull Request
36+
pool:
37+
vmImage: 'macOS-14'
38+
timeOutInMinutes: 30
39+
40+
steps:
41+
- checkout: azure-activedirectory-tokenbroker-for-objc
42+
displayName: 'Checkout Broker'
43+
clean: false
44+
submodules: false
45+
fetchTags: true
46+
persistCredentials: true
47+
48+
- checkout: self
49+
displayName: 'Checkout MSAL'
50+
clean: false
51+
submodules: false
52+
fetchTags: true
53+
path: 's/azure-activedirectory-tokenbroker-for-objc/ADAuthenticationBroker/Frameworks/microsoft-authentication-library-for-objc'
54+
persistCredentials: true
55+
56+
- task: Bash@3
57+
displayName: 'Checkout MSAL submodules + ADAL'
58+
inputs:
59+
workingDirectory: $(Pipeline.Workspace)/s
60+
targetType: 'inline'
61+
script: |
62+
cd azure-activedirectory-tokenbroker-for-objc
63+
git submodule update --init --recursive ADAuthenticationBroker/Frameworks/adal
64+
git submodule update --init ADAuthenticationBroker/Frameworks/microsoft-authentication-library-for-objc/MSAL/IdentityCore'
65+
66+
- checkout: WorkplaceJoin-for-iOS
67+
displayName: 'Checkout WPJ'
68+
clean: false
69+
submodules: false
70+
fetchTags: true
71+
path: 's/azure-activedirectory-tokenbroker-for-objc/ADAuthenticationBroker/Frameworks/WorkplaceJoin-for-iOS'
72+
persistCredentials: true
73+
74+
- task: AzureCLI@2
75+
inputs:
76+
azureSubscription: 'AuthSdkResourceManager'
77+
scriptType: 'pscore'
78+
scriptLocation: 'inlineScript'
79+
inlineScript: |
80+
# if this fails, check out this bash script that includes diagnostics:
81+
# https://gist.github.com/johnterickson/19f80a3e969e39f1000d118739176e62
82+
# uncomment these for more debugging spew
83+
# GIT_TRACE=1
84+
# GIT_CURL_VERBOSE=1
85+
86+
# Note that the resoruce is specified to limit the token to Azure DevOps
87+
$token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
88+
Write-Host "##vso[task.setvariable variable=aadToken;issecret=true]$token"
89+
- task: Bash@3
90+
displayName: 'Checkout NGC Submodules'
91+
env:
92+
AccessToken: $(MSAzureToken_encoded)
93+
inputs:
94+
workingDirectory: $(Pipeline.Workspace)/s
95+
targetType: 'inline'
96+
script: |
97+
cd azure-activedirectory-tokenbroker-for-objc/ADAuthenticationBroker/Frameworks
98+
git -c http.https://msazure.visualstudio.com/DefaultCollection/One/_git/AD-MFA-NGCAuthentication.extraheader="AUTHORIZATION: bearer $(aadToken)" submodule update --init AD-MFA-NGCAuthentication
99+
cd AD-MFA-NGCAuthentication
100+
git -c http.https://msazure.visualstudio.com/DefaultCollection/One/_git/AD-MFA-NGCKeyProvider-ios.extraheader="AUTHORIZATION: bearer $(aadToken)" submodule update --init NGCKeyProvider
101+
git -c http.https://msazure.visualstudio.com/DefaultCollection/One/_git/AD-MFA-MSAuthNetworking.extraheader="AUTHORIZATION: bearer $(aadToken)" submodule update --init MSAuthNetworking
102+
103+
- task: Bash@3
104+
displayName: 'Checkout WPJ openssl-msft submodule'
105+
inputs:
106+
workingDirectory: $(Pipeline.Workspace)/s
107+
targetType: 'inline'
108+
script: |
109+
cd azure-activedirectory-tokenbroker-for-objc
110+
REV=$(git rev-parse HEAD:ADAuthenticationBroker/Frameworks/WorkplaceJoin-for-iOS)
111+
cd ADAuthenticationBroker/Frameworks/WorkplaceJoin-for-iOS
112+
git pull origin $REV
113+
cd Frameworks
114+
git -c http.https://msazure.visualstudio.com/DefaultCollection/PlatformCrypto/_git/openssl-msft.extraheader="AUTHORIZATION: bearer $(aadToken)" submodule update --init openssl-msft
115+
116+
- task: Bash@3
117+
displayName: 'Update WPJ submodules'
118+
inputs:
119+
workingDirectory: $(Pipeline.Workspace)/s
120+
targetType: 'inline'
121+
script: |
122+
cd azure-activedirectory-tokenbroker-for-objc
123+
cd ADAuthenticationBroker/Frameworks/WorkplaceJoin-for-iOS
124+
git submodule update --init --recursive
125+
126+
- script: 'gem uninstall xcpretty -I --version 0.4.0'
127+
displayName: 'Uninstall xcpretty v0.4.0'
128+
129+
- script: 'gem install xcpretty -N -v 0.3.0'
130+
displayName: 'Install xcpretty v0.3.0'
131+
132+
- script: 'gem install slather -N'
133+
displayName: 'Install slather'
134+
135+
- task: UsePythonVersion@0
136+
displayName: 'Use Python 3.x'
137+
138+
- task: Bash@3
139+
displayName: 'Select Xcode version'
140+
inputs:
141+
targetType: 'inline'
142+
script: '/bin/bash -c "sudo xcode-select -s /Applications/Xcode_15.4.app"'
143+
144+
# The following is needed to install the visionOS SDK on macos-14 vm image which
145+
# doesn't have visionOS installed by default.
146+
# TODO: Remove when macos-14-arm64 is supported on ADO.
147+
- task: Bash@3
148+
displayName: download visionOS SDK
149+
inputs:
150+
targetType: 'inline'
151+
script: |
152+
echo "Downloading simulator for visionOS"
153+
sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
154+
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
155+
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
156+
xcodebuild -downloadPlatform visionOS
157+
failOnStderr: false
158+
159+
160+
- task: Bash@3
161+
displayName: 'Run a python script for Broker'
162+
inputs:
163+
targetType: 'inline'
164+
script: |
165+
cd azure-activedirectory-tokenbroker-for-objc
166+
echo "executing build:./build.py"
167+
python3 ./build.py
168+

0 commit comments

Comments
 (0)