Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions tools/devops/automation/run-nightly-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ stages:
use1ES: false
disableCodeQL: false
xcodeChannel: $(xcodeChannel)
statusContext: "Nightly CodeQL"
buildSteps:
- bash: $(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/tools/devops/automation/scripts/bash/build-nugets.sh
displayName: 'Build Nugets'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ steps:
makeParallelism: '4'
xcodeChannel: ${{ parameters.xcodeChannel }}
use1ES: false
requiredDiskSpace: 50
statusContext: "API diff"

# detect changes
- bash: $(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/tools/devops/automation/scripts/bash/compare.sh
Expand Down
2 changes: 2 additions & 0 deletions tools/devops/automation/templates/build/build-mac-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ steps:
xqaCertPass: ${{ parameters.xqaCertPass }}
use1ES: ${{ parameters.use1ES }}
xcodeChannel: ${{ parameters.xcodeChannel }}
statusContext: "Build macOS tests"
requiredDiskSpace: 10
buildSteps:

- bash: |
Expand Down
10 changes: 10 additions & 0 deletions tools/devops/automation/templates/build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ parameters:
- name: XcodeChannel
type: string

- name: requiredDiskSpace
type: number
default: 20

- name: statusContext
type: string
default: "Unknown context"

steps:

- template: ../common/checkout.yml
Expand All @@ -62,6 +70,8 @@ steps:
parameters:
disableCodeQL: ${{ parameters.disableCodeQL }}
keyringPass: ${{ parameters.keyringPass }}
requiredDiskSpace: ${{ parameters.requiredDiskSpace }}
statusContext: ${{ parameters.statusContext }}

- template: install-certificates.yml@yaml-templates
parameters:
Expand Down
17 changes: 17 additions & 0 deletions tools/devops/automation/templates/common/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ parameters:
default: true
- name: keyringPass
type: string
- name: requiredDiskSpace
type: number

steps:
- template: agent-cleanser/v1.yml@yaml-templates # Uninstalls mono, Xamarin.Mac (if installed) plus cleanses the Provisionator Xcode cache and kills processes at the end
Expand All @@ -28,6 +30,21 @@ steps:
continueOnError: true
timeoutInMinutes: 60

# Use a cmdlet to check if the space available in the devices root system is larger than 50 gb. If there is not
# enough space available it:
# 1. Set the status of the build to error. It is not a failure since no tests have been ran.
# 2. Set a comment stating the same as what was sent to the status.
# 3. Cancel the pipeline and do not execute any of the following steps.
- pwsh: |
Import-Module $Env:SYSTEM_DEFAULTWORKINGDIRECTORY\$Env:BUILD_REPOSITORY_TITLE\tools\devops\automation\scripts\MaciosCI.psd1
Assert-HDFreeSpace -Size ${{ parameters.requiredDiskSpace }}
env:
CONTEXT: ${{ parameters.statusContext }}
GITHUB_TOKEN: $(GitHub.Token)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
displayName: 'Check HD Free Space'
timeoutInMinutes: 5

- bash: $(System.DefaultWorkingDirectory)/$(BUILD_REPOSITORY_TITLE)/tools/devops/automation/scripts/bash/remove-ui-prompt.sh
env:
OSX_KEYCHAIN_PASS: ${{ parameters.keyringPass }}
Expand Down
15 changes: 0 additions & 15 deletions tools/devops/automation/templates/mac/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,6 @@ steps:

displayName: 'Set VM Vendor'

# Use a cmdlet to check if the space available in the devices root system is larger than 50 gb. If there is not
# enough space available it:
# 1. Set the status of the build to error. It is not a failure since no tests have been ran.
# 2. Set a comment stating the same as what was sent to the status.
# 3. Cancel the pipeline and do not execute any of the following steps.
- pwsh: |
Import-Module $Env:SYSTEM_DEFAULTWORKINGDIRECTORY\$Env:BUILD_REPOSITORY_TITLE\tools\devops\automation\scripts\MaciosCI.psd1
Assert-HDFreeSpace -Size 5
env:
CONTEXT: ${{ parameters.statusContext }}
GITHUB_TOKEN: $(GitHub.Token)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
displayName: 'Check HD Free Space'
timeoutInMinutes: 5

- task: xamops.azdevex.provisionator-task.provisionator@2
displayName: 'Provision Brew components'
inputs:
Expand Down
17 changes: 2 additions & 15 deletions tools/devops/automation/templates/tests/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,8 @@ steps:
- template: ../common/setup.yml
parameters:
keyringPass: ${{ parameters.keyringPass }}

# Use a cmdlet to check if the space available in the devices root system is larger than 50 gb. If there is not
# enough space available it:
# 1. Set a comment stating the same as what was sent to the status.
# 2. Cancel the pipeline and do not execute any of the following steps.
- pwsh: |
Import-Module ./MaciosCI.psd1
Assert-HDFreeSpace -Size 20
env:
CONTEXT: ${{ parameters.statusContext }}
GITHUB_TOKEN: $(GitHub.Token)
ACCESSTOKEN: $(System.AccessToken)
displayName: 'Check HD Free Space'
timeoutInMinutes: 5
workingDirectory: $(System.DefaultWorkingDirectory)/$(BUILD_REPOSITORY_TITLE)/tools/devops/automation/scripts/
requiredDiskSpace: 20
statusContext: ${{ parameters.statusContext }}

# if we got to this point, it means that we do have at least 50 Gb to run the test, should
# be more than enough, else the above script would have stopped the pipeline
Expand Down
1 change: 1 addition & 0 deletions tools/devops/automation/templates/tests/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@ stages:
gitHubToken: ${{ parameters.gitHubToken }}
xqaCertPass: ${{ parameters.xqaCertPass }}
XcodeChannel: ${{ parameters.XcodeChannel }}
statusContext: ${{ parameters.statusContext }}