Skip to content

Commit 2b3b0a7

Browse files
authored
Merge pull request #1463 from AzureAD/mipetriu/broker_submodule_check_yaml
Broker submodule check yaml pipeline
2 parents 2143028 + aa232cc commit 2b3b0a7

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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+
- task: Bash@3
49+
displayName: 'Checkout MSAL, ADAL, and submodules'
50+
inputs:
51+
workingDirectory: $(Pipeline.Workspace)/s
52+
targetType: 'inline'
53+
script: |
54+
cd azure-activedirectory-tokenbroker-for-objc
55+
git submodule update --init --recursive ADAuthenticationBroker/Frameworks/adal
56+
git submodule update --init ADAuthenticationBroker/Frameworks/microsoft-authentication-library-for-objc
57+
58+
- checkout: self
59+
displayName: 'Checkout IdentityCore'
60+
clean: false
61+
submodules: false
62+
fetchTags: true
63+
path: 's/azure-activedirectory-tokenbroker-for-objc/ADAuthenticationBroker/Frameworks/microsoft-authentication-library-for-objc/MSAL/IdentityCore'
64+
persistCredentials: true
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/ADAuthenticationBroker/Frameworks/WorkplaceJoin-for-iOS
110+
git -c http.https://msazure.visualstudio.com/DefaultCollection/PlatformCrypto/_git/openssl-msft.extraheader="AUTHORIZATION: bearer $(aadToken)" submodule update --init Frameworks/openssl-msft
111+
112+
- task: Bash@3
113+
displayName: 'Update WPJ submodules'
114+
inputs:
115+
workingDirectory: $(Pipeline.Workspace)/s
116+
targetType: 'inline'
117+
script: |
118+
cd azure-activedirectory-tokenbroker-for-objc/ADAuthenticationBroker/Frameworks/WorkplaceJoin-for-iOS
119+
git submodule update --init --recursive Frameworks/microsoft-authentication-library-for-objc
120+
121+
- script: 'gem uninstall xcpretty -I --version 0.4.0'
122+
displayName: 'Uninstall xcpretty v0.4.0'
123+
124+
- script: 'gem install xcpretty -N -v 0.3.0'
125+
displayName: 'Install xcpretty v0.3.0'
126+
127+
- script: 'gem install slather -N'
128+
displayName: 'Install slather'
129+
130+
- task: UsePythonVersion@0
131+
displayName: 'Use Python 3.x'
132+
133+
- task: Bash@3
134+
displayName: 'Select Xcode version'
135+
inputs:
136+
targetType: 'inline'
137+
script: '/bin/bash -c "sudo xcode-select -s /Applications/Xcode_15.4.app"'
138+
139+
# The following is needed to install the visionOS SDK on macos-14 vm image which
140+
# doesn't have visionOS installed by default.
141+
# TODO: Remove when macos-14-arm64 is supported on ADO.
142+
- task: Bash@3
143+
displayName: download visionOS SDK
144+
inputs:
145+
targetType: 'inline'
146+
script: |
147+
echo "Downloading simulator for visionOS"
148+
sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
149+
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
150+
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
151+
xcodebuild -downloadPlatform visionOS
152+
failOnStderr: false
153+
154+
155+
- task: Bash@3
156+
displayName: 'Run a python script for Broker'
157+
inputs:
158+
targetType: 'inline'
159+
script: |
160+
cd azure-activedirectory-tokenbroker-for-objc
161+
echo "executing build:./build.py"
162+
python3 ./build.py
163+

0 commit comments

Comments
 (0)