Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[ci] Comply with EO #1978

Merged
merged 6 commits into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
312 changes: 158 additions & 154 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ stages:
windowsImage: windows-2019
areaPath: 'DevDiv\Xamarin SDK'
masterBranchName: 'main'
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}: #we are shipping our product
cakeTarget: ci-release # We just want to build the library and nuget
macosImage: '' # We don't need the macOS build
preBuildSteps:
- pwsh: |
$pr = "pr." + $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
Expand Down Expand Up @@ -85,157 +88,158 @@ stages:
packageFilter: '*.nupkg'
packageVersionRegex: '(?i)^Xamarin.Essentials\.(?<version>\d+\.\d+\.\d+)(.*).nupkg$'

- stage: devicetests
displayName: Device Tests
dependsOn: []
jobs:
- job: devicetests_uwp
displayName: UWP
# skip for now
condition: false
pool:
${{ if eq(variables['System.TeamProject'], 'devdiv') }}: # The AzurePipelines-EO pool is only available in DevDiv
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesWindows2019compliant
${{ if ne(variables['System.TeamProject'], 'devdiv') }}:
vmImage: windows-2019
steps:
- script: 'certutil -importpfx $(Build.SourcesDirectory)\DeviceTests\DeviceTests.UWP\DeviceTests.UWP_TemporaryKey.pfx'
displayName: 'Run certutil'
- powershell: |
cd DeviceTests
.\build.ps1 --target=test-uwp-emu --settings_skipverification=true --verbosity=diagnostic
displayName: 'Run Device Tests - UWP'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: XUnit
testResultsFiles: '**/xunit-*.xml'
testRunTitle: 'Device Tests - UWP'

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_ios
runChecks: false
displayName: iOS
publishOutputSuffix: '-ios'
windowsImage: ''
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-ios-emu
xharness: '1.0.0-prerelease.21620.1'

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_21
runChecks: false
displayName: Android API 21
publishOutputSuffix: '-android21'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-21;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-21;google_apis;x86\""
displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_22
runChecks: false
displayName: Android API 22
publishOutputSuffix: '-android22'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-22;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-22;google_apis;x86\""
displayName: Install the Android emulators

# - template: .ci/build.v1.yml@components
# parameters:
# name: devicetests_android_api_23
# runChecks: false
# continueOnError: true
# displayName: Android API 23
# publishOutputSuffix: '-android23'
# windowsImage: '' # Mac only
# areaPath: $(AREA_PATH)
# verbosity: diagnostic
# cakeFile: DeviceTests/build.cake
# cakeTarget: test-android-emu
# cakeExtraArgs: --avd-target="`"system-images;android-23;google_apis;x86`""
# preBuildSteps:
# - bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-23;google_apis;x86\""
# displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_24
runChecks: false
displayName: Android API 24
publishOutputSuffix: '-android24'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-24;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-24;google_apis;x86\""
displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_26
runChecks: false
displayName: Android API 26
publishOutputSuffix: '-android26'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-26;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-26;google_apis;x86\""
displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_29
runChecks: false
displayName: Android API 29
publishOutputSuffix: '-android29'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-29;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-29;google_apis;x86\""
displayName: Install the Android emulators

# - template: .ci/build.v1.yml@components
# parameters:
# name: devicetests_android_api_30
# runChecks: false
# displayName: Android API 30
# publishOutputSuffix: '-android30'
# windowsImage: '' # Mac only
# areaPath: $(AREA_PATH)
# verbosity: diagnostic
# cakeFile: DeviceTests/build.cake
# cakeTarget: test-android-emu
# cakeExtraArgs: --avd-target="`"system-images;android-30;google_apis;x86`""
# preBuildSteps:
# - bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-30;google_apis;x86\""
# displayName: Install the Android emulators
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')) }}:
- stage: devicetests
displayName: Device Tests
dependsOn: []
jobs:
- job: devicetests_uwp
displayName: UWP
# skip for now
condition: false
pool:
${{ if eq(variables['System.TeamProject'], 'devdiv') }}: # The AzurePipelines-EO pool is only available in DevDiv
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesWindows2019compliant
${{ if ne(variables['System.TeamProject'], 'devdiv') }}:
vmImage: windows-2019
steps:
- script: 'certutil -importpfx $(Build.SourcesDirectory)\DeviceTests\DeviceTests.UWP\DeviceTests.UWP_TemporaryKey.pfx'
displayName: 'Run certutil'
- powershell: |
cd DeviceTests
.\build.ps1 --target=test-uwp-emu --settings_skipverification=true --verbosity=diagnostic
displayName: 'Run Device Tests - UWP'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: XUnit
testResultsFiles: '**/xunit-*.xml'
testRunTitle: 'Device Tests - UWP'

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_ios
runChecks: false
displayName: iOS
publishOutputSuffix: '-ios'
windowsImage: ''
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-ios-emu
xharness: '1.0.0-prerelease.21620.1'

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_21
runChecks: false
displayName: Android API 21
publishOutputSuffix: '-android21'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-21;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-21;google_apis;x86\""
displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_22
runChecks: false
displayName: Android API 22
publishOutputSuffix: '-android22'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-22;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-22;google_apis;x86\""
displayName: Install the Android emulators

# - template: .ci/build.v1.yml@components
# parameters:
# name: devicetests_android_api_23
# runChecks: false
# continueOnError: true
# displayName: Android API 23
# publishOutputSuffix: '-android23'
# windowsImage: '' # Mac only
# areaPath: $(AREA_PATH)
# verbosity: diagnostic
# cakeFile: DeviceTests/build.cake
# cakeTarget: test-android-emu
# cakeExtraArgs: --avd-target="`"system-images;android-23;google_apis;x86`""
# preBuildSteps:
# - bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-23;google_apis;x86\""
# displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_24
runChecks: false
displayName: Android API 24
publishOutputSuffix: '-android24'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-24;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-24;google_apis;x86\""
displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_26
runChecks: false
displayName: Android API 26
publishOutputSuffix: '-android26'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-26;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-26;google_apis;x86\""
displayName: Install the Android emulators

- template: .ci/build.v1.yml@components
parameters:
name: devicetests_android_api_29
runChecks: false
displayName: Android API 29
publishOutputSuffix: '-android29'
windowsImage: '' # Mac only
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-29;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-29;google_apis;x86\""
displayName: Install the Android emulators

# - template: .ci/build.v1.yml@components
# parameters:
# name: devicetests_android_api_30
# runChecks: false
# displayName: Android API 30
# publishOutputSuffix: '-android30'
# windowsImage: '' # Mac only
# areaPath: $(AREA_PATH)
# verbosity: diagnostic
# cakeFile: DeviceTests/build.cake
# cakeTarget: test-android-emu
# cakeExtraArgs: --avd-target="`"system-images;android-30;google_apis;x86`""
# preBuildSteps:
# - bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-30;google_apis;x86\""
# displayName: Install the Android emulators
4 changes: 4 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ Task("ci")
.IsDependentOn("tests")
.IsDependentOn("samples");

Task("ci-release")
.IsDependentOn("libs")
.IsDependentOn("nugets");

RunTarget(TARGET);