From 94e5d0c3210aa1acf217adeab000aa6047d7c375 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 20 Mar 2024 16:49:36 -0400 Subject: [PATCH 1/9] Fix device-tests.yml lint errors and warnings. --- .github/workflows/yamllint.yml | 48 ++++++++++++++++++++ eng/pipelines/device-tests.yml | 80 +++++++++++++++++----------------- 2 files changed, 88 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/yamllint.yml diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml new file mode 100644 index 000000000000..295b32794f03 --- /dev/null +++ b/.github/workflows/yamllint.yml @@ -0,0 +1,48 @@ +# yamllint disable rule:line-length rule:document-start rule:truthy +name: PR yamllint check +on: pull_request + +# This action only need a single permission in order to autoformat the code. +permissions: + contents: read + +jobs: + rebase: + name: yamllint check + runs-on: ubuntu-latest + + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + + - name: Install yamllint + run: pip install yamllint + + - name: Lint YAML pipeline files + id: lint-pipeline + working-directory: ./eng/pipelines + run: | + RESULT=$(yamllint ./eng/pipelines --f github) + if [ -n "$RESULT" ]; then + echo "YAML Lint found issues" + echo "$RESULT" + echo "::set-output name=result::$RESULT" + exit 1 + fi + + # only post a comment if the linting fails + - name: Post comment + uses: unsplash/comment-on-pr@v1.3.0 + if: failure() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: | + [yaml-lint] YamlLint found issues in the pipeline files. + ${{ steps.lint-pipeline.outputs.result }} + check_for_duplicate_msg: true + delete_prev_regex_msg: "YamlLint found issues in the pipeline files." + duplicate_msg_pattern: "YamlLint found issues in the pipeline files." diff --git a/eng/pipelines/device-tests.yml b/eng/pipelines/device-tests.yml index e6ecfff5a109..464ab47fc381 100644 --- a/eng/pipelines/device-tests.yml +++ b/eng/pipelines/device-tests.yml @@ -1,46 +1,47 @@ +# yamllint disable rule:line-length rule:document-start trigger: branches: include: - - main - - release/* - - loc + - main + - release/* + - loc tags: include: - - '*' + - '*' paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - src/Templates/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - src/Templates/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT pr: branches: include: - - main - - release/* + - main + - release/* paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - src/Templates/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - src/Templates/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT variables: - template: /eng/pipelines/common/variables.yml @@ -105,21 +106,21 @@ stages: windowsPool: ${{ parameters.windowsPool }} agentPoolAccessToken: $(AgentPoolAccessToken) ${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}: - androidApiLevels: [ 33, 30, 29, 28, 27, 26, 25, 24, 23 ] - iosVersions: [ 'simulator-17.2'] - catalystVersions: [ 'latest' ] + androidApiLevels: [33, 30, 29, 28, 27, 26, 25, 24, 23] + iosVersions: ['simulator-17.2'] + catalystVersions: ['latest'] windowsVersions: ['packaged', 'unpackaged'] provisionatorChannel: ${{ parameters.provisionatorChannel }} ${{ if not(or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv')))) }}: - androidApiLevels: [ 33, 23 ] - iosVersions: [ 'simulator-17.2' ] - catalystVersions: [ 'latest' ] + androidApiLevels: [33, 23] + iosVersions: ['simulator-17.2'] + catalystVersions: ['latest'] windowsVersions: ['packaged', 'unpackaged'] provisionatorChannel: ${{ parameters.provisionatorChannel }} projects: - name: essentials desc: Essentials - androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable + androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable windowsPackageId: 'com.microsoft.maui.essentials.devicetests' android: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj ios: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj @@ -127,7 +128,7 @@ stages: windows: $(System.DefaultWorkingDirectory)/src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj - name: graphics desc: Graphics - androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable + androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable windowsPackageId: 'com.microsoft.maui.graphics.devicetests' android: $(System.DefaultWorkingDirectory)/src/Graphics/tests/DeviceTests/Graphics.DeviceTests.csproj ios: $(System.DefaultWorkingDirectory)/src/Graphics/tests/DeviceTests/Graphics.DeviceTests.csproj @@ -135,7 +136,7 @@ stages: windows: $(System.DefaultWorkingDirectory)/src/Graphics/tests/DeviceTests/Graphics.DeviceTests.csproj - name: core desc: Core - androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable + androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable windowsPackageId: 'com.microsoft.maui.core.devicetests' android: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj ios: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj @@ -143,7 +144,7 @@ stages: windows: $(System.DefaultWorkingDirectory)/src/Core/tests/DeviceTests/Core.DeviceTests.csproj - name: controls desc: Controls - androidApiLevelsExclude: [27, 25] # Ignore for now API25 since the runs's are not stable + androidApiLevelsExclude: [27, 25] # Ignore for now API25 since the runs's are not stable windowsPackageId: 'com.microsoft.maui.controls.devicetests' android: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj @@ -151,10 +152,9 @@ stages: windows: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj - name: blazorwebview desc: BlazorWebView - androidApiLevelsExclude: [ 27, 26, 25, 24, 23, 22, 21 ] # BlazorWebView requires a recent version of Chrome + androidApiLevelsExclude: [27, 26, 25, 24, 23, 22, 21] # BlazorWebView requires a recent version of Chrome windowsPackageId: 'Microsoft.Maui.MauiBlazorWebView.DeviceTests' android: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj ios: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj catalyst: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj windows: $(System.DefaultWorkingDirectory)/src/BlazorWebView/tests/MauiDeviceTests/MauiBlazorWebView.DeviceTests.csproj - From ec5bc870b5ee7bf95a17f6830548a56b0aeb1df7 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 20 Mar 2024 16:49:56 -0400 Subject: [PATCH 2/9] Fix handlers.yml lint errors and warnings. --- eng/pipelines/handlers.yml | 313 +++++++++++++++++++------------------ 1 file changed, 157 insertions(+), 156 deletions(-) diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index 413472902794..4ace4456682f 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -1,55 +1,56 @@ +# yamllint disable rule:line-length rule:document-start trigger: branches: include: - - main - - release/* - - net7.0 - - net8.0 - - loc + - main + - release/* + - net7.0 + - net8.0 + - loc tags: include: - - '*' + - '*' paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT pr: branches: include: - - main - - release/* - - net7.0 - - net8.0 + - main + - release/* + - net7.0 + - net8.0 paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT schedules: -- cron: "0 0 * * *" - displayName: Daily midnight build - branches: - include: - - main + - cron: "0 0 * * *" + displayName: Daily midnight build + branches: + include: + - main variables: - template: /eng/pipelines/common/variables.yml @@ -82,7 +83,7 @@ parameters: poolName: $(macOSXNet6VmPool) vmImage: $(macOSXNet6VmImage) artifact: build-macos - + - name: PackPlatforms type: object default: @@ -98,20 +99,20 @@ parameters: - name: RunTemplatePlatforms type: object default: - - name: $(androidTestsVmPool) - vmImage: $(androidTestsVmImage) - demands: - - macOS.Name -equals Ventura - - macOS.Architecture -equals x64 - testName: RunOnAndroid - artifact: templates-run-android - - name: $(iosTestsVmPool) - vmImage: $(iosTestsVmImage) - demands: - - macOS.Name -equals Ventura - - macOS.Architecture -equals x64 - testName: RunOniOS - artifact: templates-run-ios + - name: $(androidTestsVmPool) + vmImage: $(androidTestsVmImage) + demands: + - macOS.Name -equals Ventura + - macOS.Architecture -equals x64 + testName: RunOnAndroid + artifact: templates-run-android + - name: $(iosTestsVmPool) + vmImage: $(iosTestsVmImage) + demands: + - macOS.Name -equals Ventura + - macOS.Architecture -equals x64 + testName: RunOniOS + artifact: templates-run-ios - name: TestTargetFrameworks type: object @@ -141,16 +142,91 @@ stages: dependsOn: [] jobs: - ${{ each BuildPlatform in parameters.BuildPlatforms }}: - - ${{ each BuildConfiguration in parameters.BuildConfigurations }}: - - job: build_net_${{ BuildPlatform.name }}_${{ BuildConfiguration }} + - ${{ each BuildConfiguration in parameters.BuildConfigurations }}: + - job: build_net_${{ BuildPlatform.name }}_${{ BuildConfiguration }} + workspace: + clean: all + displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }}) + timeoutInMinutes: 240 + condition: or( + ${{ parameters.BuildEverything }}, + ne(variables['Build.Reason'], 'PullRequest'), + eq('${{ BuildConfiguration }}', 'Release')) + pool: + name: ${{ BuildPlatform.poolName }} + vmImage: ${{ BuildPlatform.vmImage }} + demands: + - macOS.Name -equals Ventura + - macOS.Architecture -equals x64 + steps: + - template: common/provision.yml + parameters: + poolName: ${{ BuildPlatform.poolName }} + gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) + - pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic + displayName: 'Install .NET' + retryCountOnTaskFailure: 3 + env: + DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) + PRIVATE_BUILD: $(PrivateBuild) + - pwsh: ./build.ps1 --target=dotnet-build --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic + displayName: 'Build .NET Maui' + - pwsh: ./build.ps1 --target=dotnet-test --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic + displayName: 'Run Unit Tests' + - task: PublishTestResults@2 + condition: always() + inputs: + testRunner: VSTest + testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx' + - task: PublishBuildArtifacts@1 + condition: always() + displayName: Publish Artifacts (${{ BuildPlatform.artifact }}) + inputs: + ArtifactName: ${{ BuildPlatform.artifact }} + + - stage: pack_net + displayName: Pack .NET MAUI + dependsOn: [] + jobs: + - ${{ each PackPlatform in parameters.PackPlatforms }}: + - job: pack_net_${{ PackPlatform.name }} workspace: clean: all - displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }}) + displayName: ${{ PackPlatform.name }} timeoutInMinutes: 240 - condition: or( - ${{ parameters.BuildEverything }}, - ne(variables['Build.Reason'], 'PullRequest'), - eq('${{ BuildConfiguration }}', 'Release')) + pool: + name: ${{ PackPlatform.poolName }} + vmImage: ${{ PackPlatform.vmImage }} + demands: + - macOS.Name -equals Ventura + - macOS.Architecture -equals x64 + steps: + - template: common/pack.yml + parameters: + platform: ${{ PackPlatform.name }} + provisionatorChannel: ${{ parameters.provisionatorChannel }} + artifact: ${{ PackPlatform.artifact }} + artifactsPath: '(Build.ArtifactStagingDirectory)' + artifactBinaries: 'pack-binaries' + gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) + prepareSteps: + - template: common/provision.yml + parameters: + checkoutDirectory: '$(System.DefaultWorkingDirectory)' + provisionatorChannel: ${{ parameters.provisionatorChannel }} + gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) + skipAndroidImages: true + + - stage: samples_net + displayName: Test .NET MAUI Samples + dependsOn: pack_net + jobs: + - ${{ each BuildPlatform in parameters.BuildPlatforms }}: + - job: build_net_${{ BuildPlatform.name }}_samples + workspace: + clean: all + displayName: ${{ BuildPlatform.name }} + timeoutInMinutes: 120 pool: name: ${{ BuildPlatform.poolName }} vmImage: ${{ BuildPlatform.vmImage }} @@ -161,118 +237,43 @@ stages: - template: common/provision.yml parameters: poolName: ${{ BuildPlatform.poolName }} - gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) - - pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic - displayName: 'Install .NET' + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Packages' + inputs: + artifactName: nuget + itemPattern: '**/*.nupkg' + downloadPath: $(System.DefaultWorkingDirectory)/artifacts + - pwsh: Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force + displayName: Move the downloaded artifacts + - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic + displayName: 'Install .NET (Local Workloads)' retryCountOnTaskFailure: 3 env: DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) PRIVATE_BUILD: $(PrivateBuild) - - pwsh: ./build.ps1 --target=dotnet-build --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic - displayName: 'Build .NET Maui' - - pwsh: ./build.ps1 --target=dotnet-test --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic - displayName: 'Run Unit Tests' + - pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic + displayName: Build Microsoft.Maui.IntegrationTests + - pwsh: ./build.ps1 --target=dotnet-integration-test --filter="FullyQualifiedName=Microsoft.Maui.IntegrationTests.SampleTests" --resultsfilename="integration-samples" --verbosity=diagnostic + displayName: Run ${{ BuildPlatform.name }} sample build tests - task: PublishTestResults@2 + displayName: Publish the ${{ BuildPlatform.name }} sample build tests condition: always() inputs: testRunner: VSTest testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx' - - task: PublishBuildArtifacts@1 - condition: always() - displayName: Publish Artifacts (${{ BuildPlatform.artifact }}) - inputs: - ArtifactName: ${{ BuildPlatform.artifact }} - - - stage: pack_net - displayName: Pack .NET MAUI - dependsOn: [] - jobs: - - ${{ each PackPlatform in parameters.PackPlatforms }}: - - job: pack_net_${{ PackPlatform.name }} - workspace: - clean: all - displayName: ${{ PackPlatform.name }} - timeoutInMinutes: 240 - pool: - name: ${{ PackPlatform.poolName }} - vmImage: ${{ PackPlatform.vmImage }} - demands: - - macOS.Name -equals Ventura - - macOS.Architecture -equals x64 - steps: - - template: common/pack.yml - parameters: - platform: ${{ PackPlatform.name }} - provisionatorChannel: ${{ parameters.provisionatorChannel }} - artifact: ${{ PackPlatform.artifact }} - artifactsPath: '(Build.ArtifactStagingDirectory)' - artifactBinaries: 'pack-binaries' - gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) - prepareSteps: - - template: common/provision.yml - parameters: - checkoutDirectory: '$(System.DefaultWorkingDirectory)' - provisionatorChannel: ${{ parameters.provisionatorChannel }} - gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) - skipAndroidImages: true - - - stage: samples_net - displayName: Test .NET MAUI Samples - dependsOn: pack_net - jobs: - - ${{ each BuildPlatform in parameters.BuildPlatforms }}: - - job: build_net_${{ BuildPlatform.name }}_samples - workspace: - clean: all - displayName: ${{ BuildPlatform.name }} - timeoutInMinutes: 120 - pool: - name: ${{ BuildPlatform.poolName }} - vmImage: ${{ BuildPlatform.vmImage }} - demands: - - macOS.Name -equals Ventura - - macOS.Architecture -equals x64 - steps: - - template: common/provision.yml - parameters: - poolName: ${{ BuildPlatform.poolName }} - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Packages' - inputs: - artifactName: nuget - itemPattern: '**/*.nupkg' - downloadPath: $(System.DefaultWorkingDirectory)/artifacts - - pwsh: Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force - displayName: Move the downloaded artifacts - - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic - displayName: 'Install .NET (Local Workloads)' - retryCountOnTaskFailure: 3 - env: - DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) - PRIVATE_BUILD: $(PrivateBuild) - - pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic - displayName: Build Microsoft.Maui.IntegrationTests - - pwsh: ./build.ps1 --target=dotnet-integration-test --filter="FullyQualifiedName=Microsoft.Maui.IntegrationTests.SampleTests" --resultsfilename="integration-samples" --verbosity=diagnostic - displayName: Run ${{ BuildPlatform.name }} sample build tests - - task: PublishTestResults@2 - displayName: Publish the ${{ BuildPlatform.name }} sample build tests - condition: always() - inputs: - testRunner: VSTest - testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx' - testRunTitle: ${{ BuildPlatform.name }} sample build tests + testRunTitle: ${{ BuildPlatform.name }} sample build tests - stage: templates_net displayName: Test Templates dependsOn: pack_net jobs: - - template: common/maui-templates.yml - parameters: - RunPlatforms: ${{ parameters.RunTemplatePlatforms }} - BuildPlatforms: ${{ parameters.BuildPlatforms }} + - template: common/maui-templates.yml + parameters: + RunPlatforms: ${{ parameters.RunTemplatePlatforms }} + BuildPlatforms: ${{ parameters.BuildPlatforms }} - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: - - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff] - - template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback] - - template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback] + - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff] + - template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback] + - template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback] From 1e0de3483fccdd613131435a3183e68284f11a0c Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 20 Mar 2024 16:50:38 -0400 Subject: [PATCH 3/9] Fix maui-release-internal.yml lint errors and warnings. --- eng/pipelines/maui-release-internal.yml | 37 +++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/eng/pipelines/maui-release-internal.yml b/eng/pipelines/maui-release-internal.yml index 6d6679b87222..48505dd05166 100644 --- a/eng/pipelines/maui-release-internal.yml +++ b/eng/pipelines/maui-release-internal.yml @@ -1,24 +1,25 @@ +# yamllint disable rule:line-length rule:document-start trigger: branches: include: - - main - - release/* + - main + - release/* tags: include: - - '*' + - '*' paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT variables: @@ -72,7 +73,7 @@ extends: justification: 'Failing with "Could not successfully find the java tool launcher"' sourceRepositoriesToScan: exclude: - - repository: yaml-templates + - repository: yaml-templates suppression: suppressionFile: $(Build.SourcesDirectory)\eng\automation\guardian\source.gdnsuppress stages: @@ -85,9 +86,9 @@ extends: clean: all displayName: ${{ parameters.PackPlatform.name }} timeoutInMinutes: 240 - + pool: ${{ parameters.VM_IMAGE_HOST }} - + templateContext: outputs: - output: pipelineArtifact @@ -100,5 +101,5 @@ extends: parameters: platform: ${{ parameters.PackPlatform.name }} provisionatorChannel: ${{ parameters.provisionatorChannel }} - artifact: ${{ parameters.PackPlatform.artifact }} - artifactsPath: '(Build.ArtifactStagingDirectory)' \ No newline at end of file + artifact: ${{ parameters.PackPlatform.artifact }} + artifactsPath: '(Build.ArtifactStagingDirectory)' From 56078e7cf122aabf48ccfe410f2bf3139f9be1a4 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 20 Mar 2024 16:50:55 -0400 Subject: [PATCH 4/9] Fix maui-release.yml lint errors and warnings. --- eng/pipelines/maui-release.yml | 83 +++++++++++++++++----------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/eng/pipelines/maui-release.yml b/eng/pipelines/maui-release.yml index 39691783bb0f..e500265f61b2 100644 --- a/eng/pipelines/maui-release.yml +++ b/eng/pipelines/maui-release.yml @@ -1,24 +1,25 @@ +# yamllint disable rule:line-length rule:document-start trigger: branches: include: - - main - - release/* + - main + - release/* tags: include: - - '*' + - '*' paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT variables: @@ -87,7 +88,7 @@ extends: justification: 'Failing with "Could not successfully find the java tool launcher"' sourceRepositoriesToScan: exclude: - - repository: yaml-templates + - repository: yaml-templates suppression: suppressionFile: $(Build.SourcesDirectory)\eng\automation\guardian\source.gdnsuppress stages: @@ -100,16 +101,16 @@ extends: clean: all displayName: ${{ parameters.PackPlatform.name }} timeoutInMinutes: 240 - + pool: ${{ parameters.VM_IMAGE_HOST }} - + templateContext: outputs: - output: pipelineArtifact displayName: 'Publish the ${{ parameters.PackPlatform.artifact }} artifacts' artifactName: ${{ parameters.PackPlatform.artifact }} targetPath: '(Build.ArtifactStagingDirectory)' - + - output: pipelineArtifact displayName: 'Publish the ${{ parameters.PackPlatform.binariesArtifact }} artifacts' artifactName: ${{ parameters.PackPlatform.binariesArtifact }} @@ -137,28 +138,26 @@ extends: gitHubToken: $(github--pat--vs-mobiletools-engineering-service2) skipAndroidImages: true - - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: # Sign only using the private server - - template: /eng/pipelines/common/sign.yml@self - parameters: - dependsOn: ['pack_net'] - stageName: 'nuget_signing' - poolName: ${{ parameters.VM_IMAGE_HOST.name }} - vmImage: ${{ parameters.VM_IMAGE_HOST.image }} - os: ${{ parameters.VM_IMAGE_HOST.os }} - - - template: /eng/pipelines/common/insertion.yml@self # Insert on VS and SDK - parameters: - dependsOn: ['nuget_signing'] - stageName: 'sdk_insertion' - poolName: ${{ parameters.VM_IMAGE_HOST.name }} - vmImage: ${{ parameters.VM_IMAGE_HOST.image }} - os: ${{ parameters.VM_IMAGE_HOST.os }} - pushMauiPackagesToMaestro: ${{ parameters.pushMauiPackagesToMaestro }} - - - template: /eng/pipelines/common/apiscan.yml@self # ApiScan - parameters: - dependsOn: ['pack_net'] - os: windows - scanArtifacts: ['${{ parameters.PackPlatform.binariesArtifact }}'] - - + - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: # Sign only using the private server + - template: /eng/pipelines/common/sign.yml@self + parameters: + dependsOn: ['pack_net'] + stageName: 'nuget_signing' + poolName: ${{ parameters.VM_IMAGE_HOST.name }} + vmImage: ${{ parameters.VM_IMAGE_HOST.image }} + os: ${{ parameters.VM_IMAGE_HOST.os }} + + - template: /eng/pipelines/common/insertion.yml@self # Insert on VS and SDK + parameters: + dependsOn: ['nuget_signing'] + stageName: 'sdk_insertion' + poolName: ${{ parameters.VM_IMAGE_HOST.name }} + vmImage: ${{ parameters.VM_IMAGE_HOST.image }} + os: ${{ parameters.VM_IMAGE_HOST.os }} + pushMauiPackagesToMaestro: ${{ parameters.pushMauiPackagesToMaestro }} + + - template: /eng/pipelines/common/apiscan.yml@self # ApiScan + parameters: + dependsOn: ['pack_net'] + os: windows + scanArtifacts: ['${{ parameters.PackPlatform.binariesArtifact }}'] From 4a5e3ae4cddaf048ed4b860c215ed1350b3da82f Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 20 Mar 2024 16:51:12 -0400 Subject: [PATCH 5/9] Fix ui-tests.yml lint errors and warnings. --- eng/pipelines/ui-tests.yml | 76 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/eng/pipelines/ui-tests.yml b/eng/pipelines/ui-tests.yml index c2269ed23e66..3a6a65df95e3 100644 --- a/eng/pipelines/ui-tests.yml +++ b/eng/pipelines/ui-tests.yml @@ -1,46 +1,47 @@ +# yamllint disable rule:line-length rule:document-start trigger: branches: include: - - main - - release/* - - loc + - main + - release/* + - loc tags: include: - - '*' + - '*' paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - src/Templates/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - src/Templates/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT pr: branches: include: - - main - - release/* + - main + - release/* paths: include: - - '*' + - '*' exclude: - - .github/* - - docs/* - - src/Templates/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + - .github/* + - docs/* + - src/Templates/* + - CODE-OF-CONDUCT.md + - CONTRIBUTING.md + - LICENSE.TXT + - PATENTS.TXT + - README.md + - SECURITY.md + - THIRD-PARTY-NOTICES.TXT variables: - template: /eng/pipelines/common/variables.yml @@ -78,7 +79,7 @@ parameters: demands: - macOS.Name -equals Ventura - macOS.Architecture -equals x64 - + - name: windowsPool type: object default: @@ -130,27 +131,26 @@ stages: iosCompatibilityPool: ${{ parameters.iosCompatibilityPool }} agentPoolAccessToken: $(AgentPoolAccessToken) ${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}: - androidApiLevels: [ 30 ] - iosVersions: [ '17.2' ] + androidApiLevels: [30] + iosVersions: ['17.2'] provisionatorChannel: ${{ parameters.provisionatorChannel }} ${{ if not(or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv')))) }}: - androidApiLevels: [ 30 ] - iosVersions: [ '17.2' ] + androidApiLevels: [30] + iosVersions: ['17.2'] provisionatorChannel: ${{ parameters.provisionatorChannel }} ${{ if or(parameters.CompatibilityTests, ne(variables['Build.Reason'], 'PullRequest')) }}: runCompatibilityTests: true projects: - name: controls desc: Controls - androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable + androidApiLevelsExclude: [25] # Ignore for now API25 since the runs's are not stable android: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj app: $(System.DefaultWorkingDirectory)/src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj - iosVersionsExclude: [ '12.4'] # Ignore iOS 12.4 while we can't make it work on CI + iosVersionsExclude: ['12.4'] # Ignore iOS 12.4 while we can't make it work on CI ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj winui: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj mac: $(System.DefaultWorkingDirectory)/src/Controls/tests/UITests/Controls.AppiumTests.csproj - compatibilityAndroidApp: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj + compatibilityAndroidApp: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/src/Android/Compatibility.ControlGallery.Android.csproj compatibilityAndroidTestProject: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/test/Android.UITests/Compatibility.ControlGallery.Android.UITests.csproj - compatibilityiOSApp: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj + compatibilityiOSApp: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj compatibilityiOSTestProject: $(System.DefaultWorkingDirectory)/src/Compatibility/ControlGallery/test/iOS.UITests/Compatibility.ControlGallery.iOS.UITests.csproj - From cdba95326787621128f1a95accd2f749f6143c1a Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 20 Mar 2024 17:12:15 -0400 Subject: [PATCH 6/9] Fix all yamlllint issues with the common templates. --- eng/pipelines/common/apiscan.yml | 1 + eng/pipelines/common/device-tests-steps.yml | 105 ++--- eng/pipelines/common/device-tests.yml | 289 +++++++------- eng/pipelines/common/insertion.yml | 14 +- .../common/localization-handback.yml | 10 +- eng/pipelines/common/localization-handoff.yml | 9 +- eng/pipelines/common/maui-templates.yml | 359 +++++++++--------- .../common/merge-translations-update.yml | 5 +- eng/pipelines/common/pack.yml | 173 ++++----- eng/pipelines/common/provision.yml | 123 +++--- eng/pipelines/common/sdk-insertion.yml | 145 +++---- eng/pipelines/common/sign.yml | 35 +- .../common/ui-tests-compatibility-steps.yml | 19 +- eng/pipelines/common/ui-tests-steps.yml | 31 +- eng/pipelines/common/ui-tests.yml | 265 ++++++------- eng/pipelines/common/variables.yml | 130 +++---- 16 files changed, 865 insertions(+), 848 deletions(-) diff --git a/eng/pipelines/common/apiscan.yml b/eng/pipelines/common/apiscan.yml index 4fad4b4c45e4..e77a0ee2d247 100644 --- a/eng/pipelines/common/apiscan.yml +++ b/eng/pipelines/common/apiscan.yml @@ -1,3 +1,4 @@ +# yamllint disable rule:line-length rule:document-start parameters: poolName: MAUI-1ESPT vmImage: '1ESPT-Windows2022' diff --git a/eng/pipelines/common/device-tests-steps.yml b/eng/pipelines/common/device-tests-steps.yml index 42de5562ab69..8e02b3a6bdc0 100644 --- a/eng/pipelines/common/device-tests-steps.yml +++ b/eng/pipelines/common/device-tests-steps.yml @@ -1,9 +1,10 @@ +# yamllint disable rule:line-length rule:document-start parameters: - platform: '' # [ android, ios, catalyst, windows ] - path: '' # path to csproj - device: '' # the xharness device to use - apiversion: '' # the iOS device api version to use - cakeArgs: '' # additional cake args + platform: '' # [ android, ios, catalyst, windows ] + path: '' # path to csproj + device: '' # the xharness device to use + apiversion: '' # the iOS device api version to use + cakeArgs: '' # additional cake args provisionatorChannel: 'latest' agentPoolAccessToken: '' artifactName: 'nuget' @@ -14,13 +15,13 @@ parameters: steps: - ${{ if eq(parameters.platform, 'ios')}}: - - bash: | - chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh - chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-simulator-runtime.sh - $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh - displayName: 'Clean bot' - continueOnError: true - timeoutInMinutes: 60 + - bash: | + chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh + chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-simulator-runtime.sh + $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh + displayName: 'Clean bot' + continueOnError: true + timeoutInMinutes: 60 - template: provision.yml parameters: ${{ if eq(parameters.platform, 'windows')}}: @@ -46,27 +47,27 @@ steps: - ${{ if eq(parameters.useArtifacts, true) }}: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Packages' - inputs: - artifactName: ${{ parameters.artifactName }} - itemPattern: ${{ parameters.artifactItemPattern }} - downloadPath: $(System.DefaultWorkingDirectory)/artifacts + - task: DownloadBuildArtifacts@0 + displayName: 'Download Packages' + inputs: + artifactName: ${{ parameters.artifactName }} + itemPattern: ${{ parameters.artifactItemPattern }} + downloadPath: $(System.DefaultWorkingDirectory)/artifacts - - pwsh: Move-Item -Path artifacts\${{ parameters.artifactName }}\*.nupkg -Destination artifacts -Force - displayName: Move the downloaded artifacts + - pwsh: Move-Item -Path artifacts\${{ parameters.artifactName }}\*.nupkg -Destination artifacts -Force + displayName: Move the downloaded artifacts - - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic - displayName: 'Install .NET (Local Workloads)' - retryCountOnTaskFailure: 2 - workingDirectory: ${{ parameters.checkoutDirectory }} - env: - DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) - PRIVATE_BUILD: $(PrivateBuild) + - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic + displayName: 'Install .NET (Local Workloads)' + retryCountOnTaskFailure: 2 + workingDirectory: ${{ parameters.checkoutDirectory }} + env: + DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) + PRIVATE_BUILD: $(PrivateBuild) - ${{ else }}: - - pwsh: ./build.ps1 --target=dotnet-buildtasks --configuration="Release" - displayName: 'Build the MSBuild Tasks' + - pwsh: ./build.ps1 --target=dotnet-buildtasks --configuration="Release" + displayName: 'Build the MSBuild Tasks' - pwsh: | $platformName = 'Windows' @@ -80,12 +81,12 @@ steps: displayName: 'Set Platform.Name' - ${{ if eq(parameters.platform, 'ios')}}: - - bash: | - if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi - if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi - displayName: Delete Old Simulator Logs - condition: always() - continueOnError: true + - bash: | + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi + displayName: Delete Old Simulator Logs + condition: always() + continueOnError: true - pwsh: | ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --apiversion=${{ parameters.apiversion }} --packageid=${{ parameters.windowsPackageId }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }} @@ -103,22 +104,22 @@ steps: retryCountOnTaskFailure: 1 - ${{ if eq(parameters.platform, 'ios')}}: - - bash: | - suffix=$(date +%Y%m%d%H%M%S) - zip -9r "$(LogDirectory)/CoreSimulatorLog_${suffix}.zip" "$HOME/Library/Logs/CoreSimulator/" - zip -9r "$(LogDirectory)/DiagnosticReports_${suffix}.zip" "$HOME/Library/Logs/DiagnosticReports/" - displayName: Zip Simulator Logs - condition: always() - continueOnError: true + - bash: | + suffix=$(date +%Y%m%d%H%M%S) + zip -9r "$(LogDirectory)/CoreSimulatorLog_${suffix}.zip" "$HOME/Library/Logs/CoreSimulator/" + zip -9r "$(LogDirectory)/DiagnosticReports_${suffix}.zip" "$HOME/Library/Logs/DiagnosticReports/" + displayName: Zip Simulator Logs + condition: always() + continueOnError: true - ${{ if eq(parameters.platform, 'ios')}}: - - bash: | - zip -9r "$(LogDirectory)/CoreSimulatorLog.zip" "$HOME/Library/Logs/CoreSimulator/" - zip -9r "$(LogDirectory)/DiagnosticReports.zip" "$HOME/Library/Logs/DiagnosticReports/" - displayName: Zip Simulator Logs - condition: always() - continueOnError: true + - bash: | + zip -9r "$(LogDirectory)/CoreSimulatorLog.zip" "$HOME/Library/Logs/CoreSimulator/" + zip -9r "$(LogDirectory)/DiagnosticReports.zip" "$HOME/Library/Logs/DiagnosticReports/" + displayName: Zip Simulator Logs + condition: always() + continueOnError: true - task: PublishTestResults@2 displayName: Publish the $(Agent.JobName) test results @@ -135,7 +136,7 @@ steps: artifactName: '$(Agent.JobName) (attempt $(System.JobAttempt))' - ${{ if eq(parameters.rebootAgent, true) }}: - # This must always be placed as the last step in the job - - template: agent-rebooter/mac.v1.yml@yaml-templates - parameters: - AgentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + # This must always be placed as the last step in the job + - template: agent-rebooter/mac.v1.yml@yaml-templates + parameters: + AgentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} diff --git a/eng/pipelines/common/device-tests.yml b/eng/pipelines/common/device-tests.yml index 1f44dd41e485..341891be2da2 100644 --- a/eng/pipelines/common/device-tests.yml +++ b/eng/pipelines/common/device-tests.yml @@ -1,12 +1,13 @@ +# yamllint disable rule:line-length rule:document-start parameters: - androidPool: { } - iosPool: { } - catalystPool: { } - windowsPool: { } - androidApiLevels: [ 33 ] - iosVersions: [ 'latest' ] - iosDeviceVersions: [ '15' ] - catalystVersions: [ 'latest' ] + androidPool: {} + iosPool: {} + catalystPool: {} + windowsPool: {} + androidApiLevels: [33] + iosVersions: ['latest'] + iosDeviceVersions: ['15'] + catalystVersions: ['latest'] provisionatorChannel: 'latest' agentPoolAccessToken: '' artifactName: 'nuget' @@ -25,154 +26,154 @@ stages: displayName: Android Device Tests dependsOn: [] jobs: - - job: android_device_tests - workspace: - clean: all - displayName: "Android emulator tests" - pool: ${{ parameters.androidPool }} - timeoutInMinutes: 60 - strategy: - matrix: - # create all the variables used for the matrix - ${{ each project in parameters.projects }}: - ${{ if ne(project.android, '') }}: - ${{ each api in parameters.androidApiLevels }}: - ${{ if not(containsValue(project.androidApiLevelsExclude, api)) }}: - ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_API_${{ api }}: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - PROJECT_PATH: ${{ project.android }} - ${{ if eq(api, 27) }}: - DEVICE: android-emulator-32_${{ api }} - APIVERSION: ${{ api }} - ${{ if not(eq(api, 27)) }}: - DEVICE: android-emulator-64_${{ api }} - APIVERSION: ${{ api }} - steps: - - template: device-tests-steps.yml - parameters: - platform: android - path: $(PROJECT_PATH) - device: $(DEVICE) - apiVersion: $(APIVERSION) - windowsPackageId: android # Only needed for Windows, will be ignored - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - artifactName: ${{ parameters.artifactName }} - artifactItemPattern: ${{ parameters.artifactItemPattern }} - checkoutDirectory: ${{ parameters.checkoutDirectory }} - useArtifacts: ${{ parameters.useArtifacts }} + - job: android_device_tests + workspace: + clean: all + displayName: "Android emulator tests" + pool: ${{ parameters.androidPool }} + timeoutInMinutes: 60 + strategy: + matrix: + # create all the variables used for the matrix + ${{ each project in parameters.projects }}: + ${{ if ne(project.android, '') }}: + ${{ each api in parameters.androidApiLevels }}: + ${{ if not(containsValue(project.androidApiLevelsExclude, api)) }}: + ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_API_${{ api }}: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + PROJECT_PATH: ${{ project.android }} + ${{ if eq(api, 27) }}: + DEVICE: android-emulator-32_${{ api }} + APIVERSION: ${{ api }} + ${{ if not(eq(api, 27)) }}: + DEVICE: android-emulator-64_${{ api }} + APIVERSION: ${{ api }} + steps: + - template: device-tests-steps.yml + parameters: + platform: android + path: $(PROJECT_PATH) + device: $(DEVICE) + apiVersion: $(APIVERSION) + windowsPackageId: android # Only needed for Windows, will be ignored + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + artifactName: ${{ parameters.artifactName }} + artifactItemPattern: ${{ parameters.artifactItemPattern }} + checkoutDirectory: ${{ parameters.checkoutDirectory }} + useArtifacts: ${{ parameters.useArtifacts }} - stage: ios_device_tests displayName: iOS Device Tests dependsOn: [] jobs: - - job: ios_device_tests - workspace: - clean: all - displayName: "iOS tests" - pool: ${{ parameters.iosPool }} - timeoutInMinutes: 140 - strategy: - matrix: - # create all the variables used for the matrix - ${{ each project in parameters.projects }}: - ${{ if ne(project.ios, '') }}: - ${{ each version in parameters.iosVersions }}: - ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: - ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - PROJECT_PATH: ${{ project.ios }} - ${{ if contains(version, 'device') }}: - DEVICE: ios-device - APIVERSION: ${{ replace(version, 'device-', '') }} - ${{ else }}: - DEVICE: ios-simulator-64_${{ replace(version, 'simulator-', '') }} - APIVERSION: ${{ replace(version, 'simulator-', '') }} - steps: - - template: device-tests-steps.yml - parameters: - platform: ios - path: $(PROJECT_PATH) - device: $(DEVICE) - apiVersion: $(APIVERSION) - windowsPackageId: ios # Only needed for Windows, will be ignored - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - artifactName: ${{ parameters.artifactName }} - artifactItemPattern: ${{ parameters.artifactItemPattern }} - checkoutDirectory: ${{ parameters.checkoutDirectory }} - useArtifacts: ${{ parameters.useArtifacts }} + - job: ios_device_tests + workspace: + clean: all + displayName: "iOS tests" + pool: ${{ parameters.iosPool }} + timeoutInMinutes: 140 + strategy: + matrix: + # create all the variables used for the matrix + ${{ each project in parameters.projects }}: + ${{ if ne(project.ios, '') }}: + ${{ each version in parameters.iosVersions }}: + ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: + ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + PROJECT_PATH: ${{ project.ios }} + ${{ if contains(version, 'device') }}: + DEVICE: ios-device + APIVERSION: ${{ replace(version, 'device-', '') }} + ${{ else }}: + DEVICE: ios-simulator-64_${{ replace(version, 'simulator-', '') }} + APIVERSION: ${{ replace(version, 'simulator-', '') }} + steps: + - template: device-tests-steps.yml + parameters: + platform: ios + path: $(PROJECT_PATH) + device: $(DEVICE) + apiVersion: $(APIVERSION) + windowsPackageId: ios # Only needed for Windows, will be ignored + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + artifactName: ${{ parameters.artifactName }} + artifactItemPattern: ${{ parameters.artifactItemPattern }} + checkoutDirectory: ${{ parameters.checkoutDirectory }} + useArtifacts: ${{ parameters.useArtifacts }} - stage: catalyst_device_tests displayName: macOS Device Tests dependsOn: [] jobs: - - job: catalyst_device_tests - workspace: - clean: all - displayName: "macOS tests" - pool: ${{ parameters.catalystPool }} - timeoutInMinutes: 240 - strategy: - matrix: - # create all the variables used for the matrix - ${{ each project in parameters.projects }}: - ${{ if ne(project.catalyst, '') }}: - ${{ each version in parameters.catalystVersions }}: - ${{ if not(containsValue(project.catalystVersionsExclude, version)) }}: - ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - PROJECT_PATH: ${{ project.catalyst }} - ${{ if eq(version, 'latest') }}: - DEVICE: maccatalyst - ${{ else }}: - DEVICE: maccatalyst_${{ version }} - steps: - - template: device-tests-steps.yml - parameters: - platform: catalyst - path: $(PROJECT_PATH) - device: $(DEVICE) - apiVersion: macos # Only needed for iOS, will be ignored - windowsPackageId: catalyst # Only needed for Windows, will be ignored - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - artifactName: ${{ parameters.artifactName }} - artifactItemPattern: ${{ parameters.artifactItemPattern }} - checkoutDirectory: ${{ parameters.checkoutDirectory }} - useArtifacts: ${{ parameters.useArtifacts }} + - job: catalyst_device_tests + workspace: + clean: all + displayName: "macOS tests" + pool: ${{ parameters.catalystPool }} + timeoutInMinutes: 240 + strategy: + matrix: + # create all the variables used for the matrix + ${{ each project in parameters.projects }}: + ${{ if ne(project.catalyst, '') }}: + ${{ each version in parameters.catalystVersions }}: + ${{ if not(containsValue(project.catalystVersionsExclude, version)) }}: + ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + PROJECT_PATH: ${{ project.catalyst }} + ${{ if eq(version, 'latest') }}: + DEVICE: maccatalyst + ${{ else }}: + DEVICE: maccatalyst_${{ version }} + steps: + - template: device-tests-steps.yml + parameters: + platform: catalyst + path: $(PROJECT_PATH) + device: $(DEVICE) + apiVersion: macos # Only needed for iOS, will be ignored + windowsPackageId: catalyst # Only needed for Windows, will be ignored + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + artifactName: ${{ parameters.artifactName }} + artifactItemPattern: ${{ parameters.artifactItemPattern }} + checkoutDirectory: ${{ parameters.checkoutDirectory }} + useArtifacts: ${{ parameters.useArtifacts }} - stage: windows_device_tests displayName: Windows Device Tests dependsOn: [] jobs: - - job: windows_device_tests - workspace: - clean: all - displayName: "Windows device tests" - pool: ${{ parameters.windowsPool }} - timeoutInMinutes: 240 # how long to run the job before automatically cancelling - strategy: - matrix: - # create all the variables used for the matrix - ${{ each project in parameters.projects }}: - ${{ if ne(project.windows, '') }}: - ${{ each version in parameters.windowsVersions }}: - ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_${{ version }}: - PROJECT_PATH: ${{ project.windows }} - PACKAGE_ID: ${{ project.windowsPackageId }} - DEVICE: ${{ version }} - steps: - - template: device-tests-steps.yml - parameters: - platform: windows - path: $(PROJECT_PATH) - apiVersion: 10.0.19041.0 - windowsPackageId: $(PACKAGE_ID) - device: $(DEVICE) # For Windows this switches between packaged and unpackaged - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - artifactName: ${{ parameters.artifactName }} - artifactItemPattern: ${{ parameters.artifactItemPattern }} - checkoutDirectory: ${{ parameters.checkoutDirectory }} - useArtifacts: ${{ parameters.useArtifacts }} \ No newline at end of file + - job: windows_device_tests + workspace: + clean: all + displayName: "Windows device tests" + pool: ${{ parameters.windowsPool }} + timeoutInMinutes: 240 # how long to run the job before automatically cancelling + strategy: + matrix: + # create all the variables used for the matrix + ${{ each project in parameters.projects }}: + ${{ if ne(project.windows, '') }}: + ${{ each version in parameters.windowsVersions }}: + ${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_${{ version }}: + PROJECT_PATH: ${{ project.windows }} + PACKAGE_ID: ${{ project.windowsPackageId }} + DEVICE: ${{ version }} + steps: + - template: device-tests-steps.yml + parameters: + platform: windows + path: $(PROJECT_PATH) + apiVersion: 10.0.19041.0 + windowsPackageId: $(PACKAGE_ID) + device: $(DEVICE) # For Windows this switches between packaged and unpackaged + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + artifactName: ${{ parameters.artifactName }} + artifactItemPattern: ${{ parameters.artifactItemPattern }} + checkoutDirectory: ${{ parameters.checkoutDirectory }} + useArtifacts: ${{ parameters.useArtifacts }} diff --git a/eng/pipelines/common/insertion.yml b/eng/pipelines/common/insertion.yml index bbd556645c02..8b7e5a0b4ede 100644 --- a/eng/pipelines/common/insertion.yml +++ b/eng/pipelines/common/insertion.yml @@ -1,3 +1,4 @@ +# yamllint disable rule:line-length rule:document-start parameters: poolName: VSEngSS-MicroBuild2022-1ES vmImage: '' @@ -13,10 +14,9 @@ stages: dependsOn: ${{ parameters.dependsOn }} condition: and(succeeded(), eq(variables.signingCondition, true)) jobs: - - template: /eng/pipelines/common/sdk-insertion.yml@self - parameters: - poolName: ${{ parameters.poolName }} - vmImage: ${{ parameters.vmImage }} - os: ${{ parameters.os }} - pushMauiPackagesToMaestro: ${{ parameters.pushMauiPackagesToMaestro }} - + - template: /eng/pipelines/common/sdk-insertion.yml@self + parameters: + poolName: ${{ parameters.poolName }} + vmImage: ${{ parameters.vmImage }} + os: ${{ parameters.os }} + pushMauiPackagesToMaestro: ${{ parameters.pushMauiPackagesToMaestro }} diff --git a/eng/pipelines/common/localization-handback.yml b/eng/pipelines/common/localization-handback.yml index 6ff96f8d14d2..d7561a70d22d 100644 --- a/eng/pipelines/common/localization-handback.yml +++ b/eng/pipelines/common/localization-handback.yml @@ -1,4 +1,4 @@ - +# yamllint disable rule:line-length rule:document-start stages: - stage: localization_handback displayName: Localization Handback @@ -6,9 +6,9 @@ stages: condition: and(succeeded(), eq(variables.isLocBranch, true)) jobs: - - job : generate_resx + - job: generate_resx displayName: 'Process incoming translations' - pool: $(HostedWinVS2019) + pool: $(HostedWinVS2019) steps: - checkout: self persistCredentials: true @@ -44,7 +44,7 @@ stages: - task: cesve.one-loc-build.one-loc-build.OneLocBuild@2 displayName: 'Localization Build' env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) inputs: locProj: 'eng/automation/LocProject.json' outDir: '$(Build.ArtifactStagingDirectory)' @@ -92,7 +92,7 @@ stages: $response = Invoke-WebRequest -UseBasicParsing -Method POST -Headers $headers -Uri "https://api.github.com/repos/dotnet/maui/pulls" -Body ($payload | ConvertTo-json) $newPr = $response.Content | ConvertFrom-Json - Write-Host "Response is $newPr" + Write-Host "Response is $newPr" displayName: Open Pull Request - task: PublishBuildArtifacts@1 diff --git a/eng/pipelines/common/localization-handoff.yml b/eng/pipelines/common/localization-handoff.yml index bb1f34b07bdf..beeba7ec88bc 100644 --- a/eng/pipelines/common/localization-handoff.yml +++ b/eng/pipelines/common/localization-handoff.yml @@ -1,3 +1,4 @@ +# yamllint disable rule:line-length rule:document-start stages: - stage: localization_handoff displayName: Localization Handoff @@ -5,15 +6,15 @@ stages: condition: and(succeeded(), eq(variables.isLocHandoffBranch, true)) jobs: - - job : generate_lci + - job: generate_lci displayName: 'Process outgoing strings' - pool: $(HostedWinVS2019) + pool: $(HostedWinVS2019) steps: - task: cesve.one-loc-build.one-loc-build.OneLocBuild@2 displayName: 'Localization Build' env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) + SYSTEM_ACCESSTOKEN: $(System.AccessToken) inputs: locProj: 'eng/automation/LocProject.json' outDir: '$(Build.ArtifactStagingDirectory)' @@ -24,4 +25,4 @@ stages: inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'drop' - publishLocation: 'Container' \ No newline at end of file + publishLocation: 'Container' diff --git a/eng/pipelines/common/maui-templates.yml b/eng/pipelines/common/maui-templates.yml index 505af0f9c797..101fa5ef1ed9 100644 --- a/eng/pipelines/common/maui-templates.yml +++ b/eng/pipelines/common/maui-templates.yml @@ -1,3 +1,4 @@ +# yamllint disable rule:line-length rule:document-start parameters: - name: condition default: true @@ -21,204 +22,204 @@ parameters: - name: BuildPlatforms type: object default: - - name: Windows - poolName: $(windowsNet6VmPool) - vmImage: $(windowsNet6VmImage) - artifact: templates-windows - - name: macOS - poolName: $(macOSXNet6VmPool) - vmImage: $(macOSXNet6VmImage) - artifact: templates-macos + - name: Windows + poolName: $(windowsNet6VmPool) + vmImage: $(windowsNet6VmImage) + artifact: templates-windows + - name: macOS + poolName: $(macOSXNet6VmPool) + vmImage: $(macOSXNet6VmImage) + artifact: templates-macos - name: RunPlatforms type: object default: - - name: $(androidTestsVmPool) - vmImage: $(androidTestsVmImage) - demands: - - macOS.Name -equals Ventura - - macOS.Architecture -equals x64 - testName: RunOnAndroid - artifact: templates-run-android - - name: $(iosTestsVmPool) - vmImage: $(iosTestsVmImage) - demands: - - macOS.Name -equals Ventura - - macOS.Architecture -equals x64 - testName: RunOniOS - artifact: templates-run-ios + - name: $(androidTestsVmPool) + vmImage: $(androidTestsVmImage) + demands: + - macOS.Name -equals Ventura + - macOS.Architecture -equals x64 + testName: RunOnAndroid + artifact: templates-run-android + - name: $(iosTestsVmPool) + vmImage: $(iosTestsVmImage) + demands: + - macOS.Name -equals Ventura + - macOS.Architecture -equals x64 + testName: RunOniOS + artifact: templates-run-ios - name: prepareSteps type: stepList default: [] jobs: -- job: build_maui_templates - workspace: - clean: all - displayName: 'Build platform:' - timeoutInMinutes: 240 - condition: ${{ parameters.condition}} - strategy: - matrix: - ${{ each BuildPlatform in parameters.BuildPlatforms }}: - ${{ BuildPlatform.name }}: - POOL_NAME: ${{ BuildPlatform.poolName }} - POOL_VIMAGE: ${{ BuildPlatform.vmImage }} - PLATFORM_NAME: ${{ lower(BuildPlatform.name) }} - - pool: - name: $(POOL_NAME) - vmImage: $(POOL_VIMAGE) - demands: - - macOS.Name -equals Ventura - - macOS.Architecture -equals x64 - steps: - - - ${{ each step in parameters.prepareSteps }}: - - ${{ each pair in step }}: - ${{ pair.key }}: ${{ pair.value }} - - - template: provision.yml - parameters: - checkoutDirectory: ${{ parameters.checkoutDirectory }} - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Packages' - inputs: - artifactName: ${{ parameters.artifactName }} - itemPattern: ${{ parameters.artifactItemPattern }} - downloadPath: $(System.DefaultWorkingDirectory)/artifacts - - - pwsh: Move-Item -Path artifacts\${{ parameters.artifactName }}\*.nupkg -Destination artifacts -Force - displayName: Move the downloaded artifacts - - - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic - displayName: 'Install .NET (Local Workloads)' - retryCountOnTaskFailure: 3 - workingDirectory: ${{ parameters.checkoutDirectory }} - env: - DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) - PRIVATE_BUILD: $(PrivateBuild) - - - pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic - displayName: Build Microsoft.Maui.IntegrationTests - workingDirectory: ${{ parameters.checkoutDirectory }} - - - pwsh: ./build.ps1 --target=dotnet-integration-test --filter="FullyQualifiedName=Microsoft.Maui.IntegrationTests.TemplateTests" --resultsfilename="integration-tests" --verbosity=diagnostic - displayName: Run $(PLATFORM_NAME) templates build tests - workingDirectory: ${{ parameters.checkoutDirectory }} - - - task: PublishTestResults@2 - displayName: Publish the $(PLATFORM_NAME) templates build tests - condition: always() - inputs: - testRunner: VSTest - testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx' - testRunTitle: $(PLATFORM_NAME) templates build tests - - - pwsh: | - Write-Host "Current job status is: $env:AGENT_JOBSTATUS" - if ($env:AGENT_JOBSTATUS -eq "SucceededWithIssues") { - Write-Host "##vso[task.complete result=Failed;]DONE" - } - displayName: Fail if any issues occurred - -- ${{ each RunPlatform in parameters.RunPlatforms }}: - - job: run_${{ RunPlatform.testName }} + - job: build_maui_templates workspace: clean: all - displayName: ${{ RunPlatform.testName }} + displayName: 'Build platform:' timeoutInMinutes: 240 condition: ${{ parameters.condition}} - pool: ${{ RunPlatform }} + strategy: + matrix: + ${{ each BuildPlatform in parameters.BuildPlatforms }}: + ${{ BuildPlatform.name }}: + POOL_NAME: ${{ BuildPlatform.poolName }} + POOL_VIMAGE: ${{ BuildPlatform.vmImage }} + PLATFORM_NAME: ${{ lower(BuildPlatform.name) }} + + pool: + name: $(POOL_NAME) + vmImage: $(POOL_VIMAGE) + demands: + - macOS.Name -equals Ventura + - macOS.Architecture -equals x64 steps: - - ${{ each step in parameters.prepareSteps }}: - - ${{ each pair in step }}: - ${{ pair.key }}: ${{ pair.value }} - - - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: - - bash: | - chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh - chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-simulator-runtime.sh - $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh - displayName: 'Clean bot' - continueOnError: true - timeoutInMinutes: 60 - - - template: provision.yml - parameters: - skipXcode: ${{ eq(RunPlatform.testName, 'RunOnAndroid') }} - checkoutDirectory: ${{ parameters.checkoutDirectory }} - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Packages' - inputs: - artifactName: ${{ parameters.artifactName }} - itemPattern: ${{ parameters.artifactItemPattern }} - downloadPath: $(System.DefaultWorkingDirectory)/artifacts - - - pwsh: Move-Item -Path artifacts\${{ parameters.artifactName }}\*.nupkg -Destination artifacts -Force - displayName: Move the downloaded artifacts - - - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic - displayName: 'Install .NET (Local Workloads)' - retryCountOnTaskFailure: 3 - workingDirectory: ${{ parameters.checkoutDirectory }} - env: - DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) - PRIVATE_BUILD: $(PrivateBuild) - - - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: - - bash: | - if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi - if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi - displayName: Delete Old Simulator Logs - condition: always() - continueOnError: true + - ${{ each step in parameters.prepareSteps }}: + - ${{ each pair in step }}: + ${{ pair.key }}: ${{ pair.value }} - # - script: dotnet tool update Microsoft.DotNet.XHarness.CLI --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json --version "9.0.0-prerelease*" -g - # displayName: install xharness + - template: provision.yml + parameters: + checkoutDirectory: ${{ parameters.checkoutDirectory }} - - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: - - pwsh: ./build.ps1 -Script eng/devices/ios.cake --target=Cleanup --verbosity=diagnostic - displayName: Reset iOS simulators - # TODO: pass properly device type/version from top-level yml - env: - IOS_TEST_DEVICE: ios-simulator-64_17.2 + - task: DownloadBuildArtifacts@0 + displayName: 'Download Packages' + inputs: + artifactName: ${{ parameters.artifactName }} + itemPattern: ${{ parameters.artifactItemPattern }} + downloadPath: $(System.DefaultWorkingDirectory)/artifacts - - pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic - displayName: Build Microsoft.Maui.IntegrationTests + - pwsh: Move-Item -Path artifacts\${{ parameters.artifactName }}\*.nupkg -Destination artifacts -Force + displayName: Move the downloaded artifacts - - pwsh: ./build.ps1 --target=dotnet-integration-test --filter="Name=${{ RunPlatform.testName }}" --resultsfilename="integration-run-${{ RunPlatform.testName }}" --verbosity=diagnostic - displayName: Run $(PLATFORM_NAME) templates run tests - continueOnError: true - # TODO: pass properly device type/version from top-level yml - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: + - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic + displayName: 'Install .NET (Local Workloads)' + retryCountOnTaskFailure: 3 + workingDirectory: ${{ parameters.checkoutDirectory }} env: - IOS_TEST_DEVICE: ios-simulator-64_17.2 - - - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: - - bash: | - suffix=$(date +%Y%m%d%H%M%S) - zip -9r "$(LogDirectory)/CoreSimulatorLog_${suffix}.zip" "$HOME/Library/Logs/CoreSimulator/" - zip -9r "$(LogDirectory)/DiagnosticReports_${suffix}.zip" "$HOME/Library/Logs/DiagnosticReports/" - displayName: Zip Simulator Logs + DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) + PRIVATE_BUILD: $(PrivateBuild) + + - pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic + displayName: Build Microsoft.Maui.IntegrationTests + workingDirectory: ${{ parameters.checkoutDirectory }} + + - pwsh: ./build.ps1 --target=dotnet-integration-test --filter="FullyQualifiedName=Microsoft.Maui.IntegrationTests.TemplateTests" --resultsfilename="integration-tests" --verbosity=diagnostic + displayName: Run $(PLATFORM_NAME) templates build tests + workingDirectory: ${{ parameters.checkoutDirectory }} + + - task: PublishTestResults@2 + displayName: Publish the $(PLATFORM_NAME) templates build tests condition: always() - continueOnError: true - - - task: PublishTestResults@2 - displayName: Publish the $(PLATFORM_NAME) templates run tests - condition: always() - inputs: - testRunner: VSTest - testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx' - testRunTitle: $(PLATFORM_NAME) templates run tests - - - pwsh: | - Write-Host "Current job status is: $env:AGENT_JOBSTATUS" - if ($env:AGENT_JOBSTATUS -eq "SucceededWithIssues") { - Write-Host "##vso[task.complete result=Failed;]DONE" - } - displayName: Fail if any issues occurred + inputs: + testRunner: VSTest + testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx' + testRunTitle: $(PLATFORM_NAME) templates build tests + + - pwsh: | + Write-Host "Current job status is: $env:AGENT_JOBSTATUS" + if ($env:AGENT_JOBSTATUS -eq "SucceededWithIssues") { + Write-Host "##vso[task.complete result=Failed;]DONE" + } + displayName: Fail if any issues occurred + + - ${{ each RunPlatform in parameters.RunPlatforms }}: + - job: run_${{ RunPlatform.testName }} + workspace: + clean: all + displayName: ${{ RunPlatform.testName }} + timeoutInMinutes: 240 + condition: ${{ parameters.condition}} + pool: ${{ RunPlatform }} + steps: + + - ${{ each step in parameters.prepareSteps }}: + - ${{ each pair in step }}: + ${{ pair.key }}: ${{ pair.value }} + + - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: + - bash: | + chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh + chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-simulator-runtime.sh + $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh + displayName: 'Clean bot' + continueOnError: true + timeoutInMinutes: 60 + + - template: provision.yml + parameters: + skipXcode: ${{ eq(RunPlatform.testName, 'RunOnAndroid') }} + checkoutDirectory: ${{ parameters.checkoutDirectory }} + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Packages' + inputs: + artifactName: ${{ parameters.artifactName }} + itemPattern: ${{ parameters.artifactItemPattern }} + downloadPath: $(System.DefaultWorkingDirectory)/artifacts + + - pwsh: Move-Item -Path artifacts\${{ parameters.artifactName }}\*.nupkg -Destination artifacts -Force + displayName: Move the downloaded artifacts + + - pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic + displayName: 'Install .NET (Local Workloads)' + retryCountOnTaskFailure: 3 + workingDirectory: ${{ parameters.checkoutDirectory }} + env: + DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) + PRIVATE_BUILD: $(PrivateBuild) + + - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: + - bash: | + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi + displayName: Delete Old Simulator Logs + condition: always() + continueOnError: true + + # - script: dotnet tool update Microsoft.DotNet.XHarness.CLI --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json --version "9.0.0-prerelease*" -g + # displayName: install xharness + + - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: + - pwsh: ./build.ps1 -Script eng/devices/ios.cake --target=Cleanup --verbosity=diagnostic + displayName: Reset iOS simulators + # TODO: pass properly device type/version from top-level yml + env: + IOS_TEST_DEVICE: ios-simulator-64_17.2 + + - pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic + displayName: Build Microsoft.Maui.IntegrationTests + + - pwsh: ./build.ps1 --target=dotnet-integration-test --filter="Name=${{ RunPlatform.testName }}" --resultsfilename="integration-run-${{ RunPlatform.testName }}" --verbosity=diagnostic + displayName: Run $(PLATFORM_NAME) templates run tests + continueOnError: true + # TODO: pass properly device type/version from top-level yml + ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: + env: + IOS_TEST_DEVICE: ios-simulator-64_17.2 + + - ${{ if eq(RunPlatform.testName, 'RunOniOS') }}: + - bash: | + suffix=$(date +%Y%m%d%H%M%S) + zip -9r "$(LogDirectory)/CoreSimulatorLog_${suffix}.zip" "$HOME/Library/Logs/CoreSimulator/" + zip -9r "$(LogDirectory)/DiagnosticReports_${suffix}.zip" "$HOME/Library/Logs/DiagnosticReports/" + displayName: Zip Simulator Logs + condition: always() + continueOnError: true + + - task: PublishTestResults@2 + displayName: Publish the $(PLATFORM_NAME) templates run tests + condition: always() + inputs: + testRunner: VSTest + testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx' + testRunTitle: $(PLATFORM_NAME) templates run tests + + - pwsh: | + Write-Host "Current job status is: $env:AGENT_JOBSTATUS" + if ($env:AGENT_JOBSTATUS -eq "SucceededWithIssues") { + Write-Host "##vso[task.complete result=Failed;]DONE" + } + displayName: Fail if any issues occurred diff --git a/eng/pipelines/common/merge-translations-update.yml b/eng/pipelines/common/merge-translations-update.yml index 45797c00129d..a1505842e9fa 100644 --- a/eng/pipelines/common/merge-translations-update.yml +++ b/eng/pipelines/common/merge-translations-update.yml @@ -1,11 +1,12 @@ +# yamllint disable rule:line-length rule:document-start stages: - stage: merge_translations_updates displayName: 'Merge Translations Updates' dependsOn: [] - condition: and( succeeded(), and( eq(variables.isTargetMainBranch, true), variables.isLocPRBranch ) ) + condition: and( succeeded(), and( eq(variables.isTargetMainBranch, true), variables.isLocPRBranch ) ) jobs: - - job : validate_merge + - job: validate_merge displayName: 'Validate and Merge Translations' pool: name: $(HostedWinVS2019) diff --git a/eng/pipelines/common/pack.yml b/eng/pipelines/common/pack.yml index bed2ca312849..d201a444f0e9 100644 --- a/eng/pipelines/common/pack.yml +++ b/eng/pipelines/common/pack.yml @@ -1,57 +1,58 @@ +# yamllint disable rule:line-length rule:document-start parameters: -- name: platform - type: string - default: '' - -- name: provisionatorChannel - type: string - default: 'latest' - -- name: artifact - type: string - default: 'nuget' - -- name: artifactBinaries - type: string - default: 'pack-binaries' - -- name: artifactsPath - type: string - default: (Build.ArtifactStagingDirectory) - -- name: nugetFolder - type: string - default: 'artifacts' - -- name: prepareSteps - type: stepList - default: [] - -- name: postSteps - type: stepList - default: [] - -- name: gitHubToken - type: string - default: $(github--pat--vs-mobiletools-engineering-service2) - -- name: checkoutDirectory - type: string - default: $(System.DefaultWorkingDirectory) - -- name: additionalArtifacts - type: object - default: [] - -- name: publishArtifacts - type: boolean - default: true + - name: platform + type: string + default: '' + + - name: provisionatorChannel + type: string + default: 'latest' + + - name: artifact + type: string + default: 'nuget' + + - name: artifactBinaries + type: string + default: 'pack-binaries' + + - name: artifactsPath + type: string + default: (Build.ArtifactStagingDirectory) + + - name: nugetFolder + type: string + default: 'artifacts' + + - name: prepareSteps + type: stepList + default: [] + + - name: postSteps + type: stepList + default: [] + + - name: gitHubToken + type: string + default: $(github--pat--vs-mobiletools-engineering-service2) + + - name: checkoutDirectory + type: string + default: $(System.DefaultWorkingDirectory) + + - name: additionalArtifacts + type: object + default: [] + + - name: publishArtifacts + type: boolean + default: true steps: - ${{ each step in parameters.prepareSteps }}: - - ${{ each pair in step }}: - ${{ pair.key }}: ${{ pair.value }} + - ${{ each pair in step }}: + ${{ pair.key }}: ${{ pair.value }} - task: PowerShell@2 condition: eq(variables['PrivateBuild'], 'true') @@ -60,8 +61,8 @@ steps: filePath: $(System.DefaultWorkingDirectory)/eng/common/SetupNugetSources.ps1 arguments: -ConfigFile $(System.DefaultWorkingDirectory)/NuGet.config -Password $Env:Token env: - Token: $(dn-bot-dnceng-artifact-feeds-rw) - + Token: $(dn-bot-dnceng-artifact-feeds-rw) + - pwsh: | if ($env:JAVA_HOME_11_X64) { $env:JAVA_HOME = $env:JAVA_HOME_11_X64 @@ -114,19 +115,19 @@ steps: PRIVATE_BUILD: $(PrivateBuild) - ${{ if eq(parameters.platform, 'Windows') }}: - - pwsh: ./build.ps1 --target=dotnet-diff --configuration="Release" --verbosity=diagnostic - displayName: 'Diff .NET Maui artifacts with NuGet' - workingDirectory: ${{ parameters.checkoutDirectory }} - - # binaries for compliance scanning - - task: CopyFiles@2 - displayName: 'Copy Binaries Files' - condition: succeeded() - inputs: - Contents: | - ${{ parameters.checkoutDirectory }}/src/Controls/src/Nuget/bin/Release/**/*.dll - TargetFolder: ${{ parameters.checkoutDirectory }}/artifacts/binaries - flattenFolders: false + - pwsh: ./build.ps1 --target=dotnet-diff --configuration="Release" --verbosity=diagnostic + displayName: 'Diff .NET Maui artifacts with NuGet' + workingDirectory: ${{ parameters.checkoutDirectory }} + + # binaries for compliance scanning + - task: CopyFiles@2 + displayName: 'Copy Binaries Files' + condition: succeeded() + inputs: + Contents: | + ${{ parameters.checkoutDirectory }}/src/Controls/src/Nuget/bin/Release/**/*.dll + TargetFolder: ${{ parameters.checkoutDirectory }}/artifacts/binaries + flattenFolders: false # artifacts - task: CopyFiles@2 @@ -162,31 +163,31 @@ steps: ${{ parameters.checkoutDirectory }}/artifacts/logs/** TargetFolder: ${{ parameters.artifactsPath }}/logs flattenFolders: true - + - ${{ if eq(parameters.publishArtifacts, 'true') }}: - - task: PublishBuildArtifacts@1 - condition: always() - displayName: publish artifacts - inputs: - ArtifactName: ${{ parameters.artifact }} - PathToPublish: ${{ parameters.artifactsPath }} - - # xml-docs - - ${{ if eq(parameters.platform, 'Windows') }}: - task: PublishBuildArtifacts@1 condition: always() - displayName: publish docs artifacts - inputs: - PathToPublish: ${{ parameters.checkoutDirectory }}/artifacts/docs-packs - ArtifactName: xml-docs - - - task: PublishBuildArtifacts@1 - condition: succeeded() - displayName: publish binaries artifacts + displayName: publish artifacts inputs: - PathToPublish: ${{ parameters.checkoutDirectory }}/artifacts/binaries - ArtifactName: ${{ parameters.artifactBinaries }} + ArtifactName: ${{ parameters.artifact }} + PathToPublish: ${{ parameters.artifactsPath }} + + # xml-docs + - ${{ if eq(parameters.platform, 'Windows') }}: + - task: PublishBuildArtifacts@1 + condition: always() + displayName: publish docs artifacts + inputs: + PathToPublish: ${{ parameters.checkoutDirectory }}/artifacts/docs-packs + ArtifactName: xml-docs + + - task: PublishBuildArtifacts@1 + condition: succeeded() + displayName: publish binaries artifacts + inputs: + PathToPublish: ${{ parameters.checkoutDirectory }}/artifacts/binaries + ArtifactName: ${{ parameters.artifactBinaries }} - ${{ each step in parameters.postSteps }}: - - ${{ each pair in step }}: - ${{ pair.key }}: ${{ pair.value }} \ No newline at end of file + - ${{ each pair in step }}: + ${{ pair.key }}: ${{ pair.value }} diff --git a/eng/pipelines/common/provision.yml b/eng/pipelines/common/provision.yml index 6c50effa4344..d5eb8308612d 100644 --- a/eng/pipelines/common/provision.yml +++ b/eng/pipelines/common/provision.yml @@ -1,3 +1,4 @@ +# yamllint disable rule:line-length rule:document-start parameters: poolName: '' clearCaches: true @@ -25,41 +26,41 @@ steps: AUTH_TOKEN_GITHUB_COM: $(github--pat--vs-mobiletools-engineering-service2) # Provision Xcode - ${{ if ne(parameters.skipXcode, 'true') }}: - - task: xamops.azdevex.provisionator-task.provisionator@2 - condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) - displayName: 'Provision Xcode' - inputs: - provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorXCodePath }} - provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} - github_token: ${{ parameters.gitHubToken }} - env: - PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} - AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }} + - task: xamops.azdevex.provisionator-task.provisionator@2 + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + displayName: 'Provision Xcode' + inputs: + provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorXCodePath }} + provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} + github_token: ${{ parameters.gitHubToken }} + env: + PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} + AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }} # Provision Additional Software - ${{ if ne(parameters.skipProvisioning, 'true') }}: - - task: xamops.azdevex.provisionator-task.provisionator@2 - displayName: 'Provision Additional Software' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) - continueOnError: true - inputs: - provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }} - provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} - github_token: ${{ parameters.gitHubToken }} - env: - PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} - AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }} - ${{ if eq(parameters.skipAndroidSdks, true) }}: - SKIP_ANDROID_API_SDKS: 'true' - ${{ if eq(parameters.skipAndroidImages, true) }}: - SKIP_ANDROID_API_IMAGES: 'true' + - task: xamops.azdevex.provisionator-task.provisionator@2 + displayName: 'Provision Additional Software' + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + continueOnError: true + inputs: + provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }} + provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} + github_token: ${{ parameters.gitHubToken }} + env: + PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} + AUTH_TOKEN_COMPONENTS_MAC_IOS_CERTIFICATE_P12: ${{ parameters.certPass }} + ${{ if eq(parameters.skipAndroidSdks, true) }}: + SKIP_ANDROID_API_SDKS: 'true' + ${{ if eq(parameters.skipAndroidImages, true) }}: + SKIP_ANDROID_API_IMAGES: 'true' # Setup JDK Paths (gradle needs it) - bash: | echo "##vso[task.setvariable variable=JI_JAVA_HOME]$(JAVA_HOME_11_X64)" echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)" displayName: 'Setup JDK Paths' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) # Configure VS Mac for Xcode # This seems to be needed or else it will pick other xcode for example on xharness - bash: | @@ -74,19 +75,19 @@ steps: # Prepare Windows # Provision Additional Software - ${{ if ne(parameters.skipProvisioning, 'true') }}: - - task: xamops.azdevex.provisionator-task.provisionator@2 - displayName: 'Provision Additional Software' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) - inputs: - provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }} - provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} - github_token: ${{ parameters.gitHubToken }} - env: - PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} - ${{ if eq(parameters.skipAndroidSdks, true) }}: - SKIP_ANDROID_API_SDKS: 'true' - ${{ if eq(parameters.skipAndroidImages, true) }}: - SKIP_ANDROID_API_IMAGES: 'true' + - task: xamops.azdevex.provisionator-task.provisionator@2 + displayName: 'Provision Additional Software' + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + inputs: + provisioning_script: ${{ parameters.checkoutDirectory }}/${{ parameters.provisionatorPath }} + provisioning_extra_args: ${{ parameters.provisionatorExtraArguments }} + github_token: ${{ parameters.gitHubToken }} + env: + PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} + ${{ if eq(parameters.skipAndroidSdks, true) }}: + SKIP_ANDROID_API_SDKS: 'true' + ${{ if eq(parameters.skipAndroidImages, true) }}: + SKIP_ANDROID_API_IMAGES: 'true' - pwsh: | if ($env:JAVA_HOME_11_X64) { @@ -136,27 +137,27 @@ steps: displayName: 'Show .NET SDK info' - ${{ if eq(parameters.clearCaches, 'true') }}: - - pwsh: dotnet nuget locals all --clear - displayName: 'Clear all NuGet caches' + - pwsh: dotnet nuget locals all --clear + displayName: 'Clear all NuGet caches' - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: - - task: PowerShell@2 - condition: eq(variables['PrivateBuild'], 'true') - displayName: Setup Private Feeds Credentials - inputs: - filePath: $(System.DefaultWorkingDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(System.DefaultWorkingDirectory)/NuGet.config -Password $Env:Token - env: - Token: $(dn-bot-dnceng-artifact-feeds-rw) - # Prepare for Reunion packages - # - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: - # - task: NuGetAuthenticate@0 - # displayName: 'Authenticate Reunion NuGet sources' - # inputs: - # nuGetServiceConnections: Project.Reunion.nuget.internal - # - pwsh: | - # $path = '$(Build.SourcesDirectory)\NuGet.config' - # [xml]$xml = Get-Content $path - # $xml.configuration.RemoveChild($xml.configuration.disabledPackageSources) - # $xml.Save($path) - # displayName: 'Add "wasdk-internal" to NuGet.config' + - task: PowerShell@2 + condition: eq(variables['PrivateBuild'], 'true') + displayName: Setup Private Feeds Credentials + inputs: + filePath: $(System.DefaultWorkingDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(System.DefaultWorkingDirectory)/NuGet.config -Password $Env:Token + env: + Token: $(dn-bot-dnceng-artifact-feeds-rw) +# Prepare for Reunion packages +# - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: +# - task: NuGetAuthenticate@0 +# displayName: 'Authenticate Reunion NuGet sources' +# inputs: +# nuGetServiceConnections: Project.Reunion.nuget.internal +# - pwsh: | +# $path = '$(Build.SourcesDirectory)\NuGet.config' +# [xml]$xml = Get-Content $path +# $xml.configuration.RemoveChild($xml.configuration.disabledPackageSources) +# $xml.Save($path) +# displayName: 'Add "wasdk-internal" to NuGet.config' diff --git a/eng/pipelines/common/sdk-insertion.yml b/eng/pipelines/common/sdk-insertion.yml index d10760fed1a2..dba364243649 100644 --- a/eng/pipelines/common/sdk-insertion.yml +++ b/eng/pipelines/common/sdk-insertion.yml @@ -1,84 +1,85 @@ +# yamllint disable rule:line-length rule:document-start parameters: poolName: VSEngSS-MicroBuild2022-1ES vmImage: '' - os: windows + os: windows pushMauiPackagesToMaestro: false nugetArtifactName: nuget-signed nugetArtifactPath: $(Build.StagingDirectory)\nuget-signed jobs: -- job: create_artifact_statuses - displayName: Create GitHub Artifact Status and Push to Maestro - timeoutInMinutes: 60 - pool: - name: ${{ parameters.poolName }} - image: ${{ parameters.vmImage }} - os: ${{ parameters.os }} - variables: - - group: Publish-Build-Assets - steps: - - checkout: self - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: ${{ parameters.nugetArtifactName }} - downloadPath: ${{ parameters.nugetArtifactPath }} - patterns: | - *.nupkg - **/*.snupkg - **/additional-assets.zip - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vs-msi-nugets - downloadPath: ${{ parameters.nugetArtifactPath }} - - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - githubToken: $(github--pat--vs-mobiletools-engineering-service2) - githubContext: $(NupkgCommitStatusName) - blobName: $(NupkgCommitStatusName) - packagePrefix: maui - artifactsPath: ${{ parameters.nugetArtifactPath }} - yamlResourceName: yaml-templates - - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - githubToken: $(github--pat--vs-mobiletools-engineering-service2) - githubContext: $(VSDropCommitStatusName) - blobName: $(VSDropCommitStatusName) - packagePrefix: maui - artifactsPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName) - yamlResourceName: yaml-templates - downloadSteps: + - job: create_artifact_statuses + displayName: Create GitHub Artifact Status and Push to Maestro + timeoutInMinutes: 60 + pool: + name: ${{ parameters.poolName }} + image: ${{ parameters.vmImage }} + os: ${{ parameters.os }} + variables: + - group: Publish-Build-Assets + steps: + - checkout: self - task: DownloadPipelineArtifact@2 inputs: - artifactName: vsdrop-signed - downloadPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName) - - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - githubToken: $(github--pat--vs-mobiletools-engineering-service2) - githubContext: $(MultiTargetVSDropCommitStatusName) - blobName: $(MultiTargetVSDropCommitStatusName) - packagePrefix: maui - artifactsPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName) - yamlResourceName: yaml-templates - downloadSteps: + artifactName: ${{ parameters.nugetArtifactName }} + downloadPath: ${{ parameters.nugetArtifactPath }} + patterns: | + *.nupkg + **/*.snupkg + **/additional-assets.zip - task: DownloadPipelineArtifact@2 inputs: - artifactName: vsdrop-multitarget-signed - downloadPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName) - - task: DotNetCoreCLI@2 - displayName: Generate and publish BAR manifest - inputs: - projects: $(Build.SourcesDirectory)\src\Workload\Microsoft.Maui.Sdk\Microsoft.Maui.Sdk.csproj - arguments: >- - -t:PushManifestToBuildAssetRegistry - -p:BuildAssetRegistryToken=$(MaestroAccessToken) - -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\ - -v:n -bl:$(Build.StagingDirectory)\binlogs\push-bar-manifest.binlog - condition: and(succeeded(), eq('${{ parameters.pushMauiPackagesToMaestro }}', 'true')) - - powershell: | - $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' - $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content - $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' - & dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n - & $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re) - displayName: Add build to default darc channel - condition: and(succeeded(), eq('${{ parameters.pushMauiPackagesToMaestro }}', 'true')) + artifactName: vs-msi-nugets + downloadPath: ${{ parameters.nugetArtifactPath }} + - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + githubToken: $(github--pat--vs-mobiletools-engineering-service2) + githubContext: $(NupkgCommitStatusName) + blobName: $(NupkgCommitStatusName) + packagePrefix: maui + artifactsPath: ${{ parameters.nugetArtifactPath }} + yamlResourceName: yaml-templates + - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + githubToken: $(github--pat--vs-mobiletools-engineering-service2) + githubContext: $(VSDropCommitStatusName) + blobName: $(VSDropCommitStatusName) + packagePrefix: maui + artifactsPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName) + yamlResourceName: yaml-templates + downloadSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vsdrop-signed + downloadPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName) + - template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + githubToken: $(github--pat--vs-mobiletools-engineering-service2) + githubContext: $(MultiTargetVSDropCommitStatusName) + blobName: $(MultiTargetVSDropCommitStatusName) + packagePrefix: maui + artifactsPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName) + yamlResourceName: yaml-templates + downloadSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vsdrop-multitarget-signed + downloadPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName) + - task: DotNetCoreCLI@2 + displayName: Generate and publish BAR manifest + inputs: + projects: $(Build.SourcesDirectory)\src\Workload\Microsoft.Maui.Sdk\Microsoft.Maui.Sdk.csproj + arguments: >- + -t:PushManifestToBuildAssetRegistry + -p:BuildAssetRegistryToken=$(MaestroAccessToken) + -p:OutputPath=$(Build.StagingDirectory)\nuget-signed\ + -v:n -bl:$(Build.StagingDirectory)\binlogs\push-bar-manifest.binlog + condition: and(succeeded(), eq('${{ parameters.pushMauiPackagesToMaestro }}', 'true')) + - powershell: | + $versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16' + $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content + $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' + & dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n + & $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --publishing-infra-version 3 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re) + displayName: Add build to default darc channel + condition: and(succeeded(), eq('${{ parameters.pushMauiPackagesToMaestro }}', 'true')) diff --git a/eng/pipelines/common/sign.yml b/eng/pipelines/common/sign.yml index cb8fbab9d1cd..063167c0a68e 100644 --- a/eng/pipelines/common/sign.yml +++ b/eng/pipelines/common/sign.yml @@ -1,3 +1,4 @@ +# yamllint disable rule:line-length rule:document-start parameters: poolName: Azure Pipelines vmImage: windows-latest @@ -21,28 +22,28 @@ stages: condition: eq(variables.signingCondition, true) use1ESTemplate: true usePipelineArtifactTasks: true - + - template: nuget-msi-convert/job/v3.yml@yaml-templates parameters: yamlResourceName: yaml-templates artifactName: nuget-signed - propsArtifactName: nuget + propsArtifactName: nuget signType: ${{ parameters.signType }} use1ESTemplate: true postConvertSteps: - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: nuget - downloadPath: $(Build.ArtifactStagingDirectory)\sign-verify - patterns: | - **/SignVerifyIgnore.txt + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: nuget + downloadPath: $(Build.ArtifactStagingDirectory)\sign-verify + patterns: | + **/SignVerifyIgnore.txt - - task: MicroBuildCodesignVerify@3 - displayName: verify signed msi content - inputs: - TargetFolders: | - $(Build.ArtifactStagingDirectory)\bin\manifests - $(Build.ArtifactStagingDirectory)\bin\manifests-multitarget - $(Build.ArtifactStagingDirectory)\bin\msi-nupkgs - ExcludeSNVerify: true - ApprovalListPathForCerts: $(Build.ArtifactStagingDirectory)\sign-verify\SignVerifyIgnore.txt + - task: MicroBuildCodesignVerify@3 + displayName: verify signed msi content + inputs: + TargetFolders: | + $(Build.ArtifactStagingDirectory)\bin\manifests + $(Build.ArtifactStagingDirectory)\bin\manifests-multitarget + $(Build.ArtifactStagingDirectory)\bin\msi-nupkgs + ExcludeSNVerify: true + ApprovalListPathForCerts: $(Build.ArtifactStagingDirectory)\sign-verify\SignVerifyIgnore.txt diff --git a/eng/pipelines/common/ui-tests-compatibility-steps.yml b/eng/pipelines/common/ui-tests-compatibility-steps.yml index 7e8fbc347429..d81f8d28cdee 100644 --- a/eng/pipelines/common/ui-tests-compatibility-steps.yml +++ b/eng/pipelines/common/ui-tests-compatibility-steps.yml @@ -1,14 +1,15 @@ +# yamllint disable rule:line-length rule:document-start parameters: - platform: '' # [ android, ios, windows, catalyst ] - path: '' # path to csproj - device: '' # the xharness device to use - cakeArgs: '' # additional cake args - app: '' #path to app to test - version: '' #the iOS version' + platform: '' # [ android, ios, windows, catalyst ] + path: '' # path to csproj + device: '' # the xharness device to use + cakeArgs: '' # additional cake args + app: '' # path to app to test + version: '' # the iOS version' provisionatorChannel: 'latest' agentPoolAccessToken: '' - configuration : "Release" - where : "cat==Issues" + configuration: "Release" + where: "cat==Issues" targetSample: "dotnet-legacy-controlgallery" provisionPlatform: "windows" @@ -32,7 +33,7 @@ steps: skipProvisioning: false skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }} provisionatorChannel: ${{ parameters.provisionatorChannel }} - + - pwsh: ./build.ps1 --target=dotnet --configuration="${{ parameters.configuration }}" --verbosity=diagnostic displayName: 'Install .NET' retryCountOnTaskFailure: 3 diff --git a/eng/pipelines/common/ui-tests-steps.yml b/eng/pipelines/common/ui-tests-steps.yml index 40123cbf9e68..6100eb8215c7 100644 --- a/eng/pipelines/common/ui-tests-steps.yml +++ b/eng/pipelines/common/ui-tests-steps.yml @@ -1,26 +1,27 @@ +# yamllint disable rule:line-length rule:document-start parameters: - platform: '' # [ android, ios, windows, catalyst ] - path: '' # path to csproj - device: '' # the xharness device to use - cakeArgs: '' # additional cake args - app: '' #path to app to test - version: '' #the iOS version' + platform: '' # [ android, ios, windows, catalyst ] + path: '' # path to csproj + device: '' # the xharness device to use + cakeArgs: '' # additional cake args + app: '' # path to app to test + version: '' # the iOS version' provisionatorChannel: 'latest' agentPoolAccessToken: '' - configuration : "Release" + configuration: "Release" steps: - ${{ if eq(parameters.platform, 'ios')}}: - - bash: | - chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh - $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh - displayName: 'Clean bot' - continueOnError: true - timeoutInMinutes: 60 + - bash: | + chmod +x $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh + $(System.DefaultWorkingDirectory)/eng/scripts/clean-bot.sh + displayName: 'Clean bot' + continueOnError: true + timeoutInMinutes: 60 - template: provision.yml parameters: - skipProvisioning: ${{ eq(parameters.platform, 'windows') }} + skipProvisioning: ${{ eq(parameters.platform, 'windows') }} skipAndroidSdks: ${{ ne(parameters.platform, 'android') }} skipXcode: ${{ or(eq(parameters.platform, 'android'), eq(parameters.platform, 'windows')) }} provisionatorChannel: ${{ parameters.provisionatorChannel }} @@ -49,7 +50,7 @@ steps: inputs: version: "20.3.1" displayName: "Install node" - + - bash: | echo "##[group]Running ls -al $(npm root -g)" ls -al $(npm root -g) diff --git a/eng/pipelines/common/ui-tests.yml b/eng/pipelines/common/ui-tests.yml index 639c8de45dfc..bb86fa1aa4b9 100644 --- a/eng/pipelines/common/ui-tests.yml +++ b/eng/pipelines/common/ui-tests.yml @@ -1,12 +1,13 @@ +# yamllint disable rule:line-length rule:document-start parameters: - androidPool: { } - iosPool: { } - windowsPool: { } - macosPool: { } - androidCompatibilityPool: { } - iosCompatibilityPool: { } - androidApiLevels: [ 30 ] - iosVersions: [ 'latest' ] + androidPool: {} + iosPool: {} + windowsPool: {} + macosPool: {} + androidCompatibilityPool: {} + iosCompatibilityPool: {} + androidApiLevels: [30] + iosVersions: ['latest'] provisionatorChannel: 'latest' agentPoolAccessToken: '' runCompatibilityTests: false @@ -30,72 +31,74 @@ stages: dependsOn: [] jobs: - ${{ each project in parameters.projects }}: - - ${{ if ne(project.android, '') }}: - - ${{ each api in parameters.androidApiLevels }}: - - ${{ if not(containsValue(project.androidApiLevelsExclude, api)) }}: - - job: android_ui_tests_${{ project.name }}_${{ api }} - timeoutInMinutes: 240 # how long to run the job before automatically cancelling - workspace: - clean: all - displayName: ${{ coalesce(project.desc, project.name) }} (API ${{ api }}) - pool: ${{ parameters.androidPool }} - variables: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - steps: - - template: ui-tests-steps.yml - parameters: - platform: android - version: ${{ api }} - path: ${{ project.android }} - app: ${{ project.app }} - ${{ if eq(api, 27) }}: - device: android-emulator-32_${{ api }} - ${{ if not(eq(api, 27)) }}: - device: android-emulator-64_${{ api }} - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + - ${{ if ne(project.android, '') }}: + - ${{ each api in parameters.androidApiLevels }}: + - ${{ if not(containsValue(project.androidApiLevelsExclude, api)) }}: + - job: android_ui_tests_${{ project.name }}_${{ api }} + timeoutInMinutes: 240 # how long to run the job before automatically cancelling + workspace: + clean: all + displayName: ${{ coalesce(project.desc, project.name) }} (API ${{ api }}) + pool: ${{ parameters.androidPool }} + variables: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + steps: + - template: ui-tests-steps.yml + parameters: + platform: android + version: ${{ api }} + path: ${{ project.android }} + app: ${{ project.app }} + ${{ if eq(api, 27) }}: + device: android-emulator-32_${{ api }} + ${{ if not(eq(api, 27)) }}: + device: android-emulator-64_${{ api }} + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - stage: ios_ui_tests displayName: iOS UITests dependsOn: [] jobs: - ${{ each project in parameters.projects }}: - - ${{ if ne(project.ios, '') }}: - - ${{ each version in parameters.iosVersions }}: - - ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: - - job: ios_ui_tests_${{ project.name }}_${{ replace(version, '.', '_') }} - timeoutInMinutes: 240 # how long to run the job before automatically cancelling - workspace: - clean: all - displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }}) - pool: ${{ parameters.iosPool }} - variables: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - steps: - - template: ui-tests-steps.yml - parameters: - platform: ios - ${{ if eq(version, 'latest') }}: - version: 16.4 - ${{ if ne(version, 'latest') }}: - version: ${{ version }} - path: ${{ project.ios }} - app: ${{ project.app }} - ${{ if eq(version, 'latest') }}: - device: ios-simulator-64 - ${{ if ne(version, 'latest') }}: - device: ios-simulator-64_${{ version }} - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + - ${{ if ne(project.ios, '') }}: + - ${{ each version in parameters.iosVersions }}: + - ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: + - job: ios_ui_tests_${{ project.name }}_${{ replace(version, '.', '_') }} + timeoutInMinutes: 240 # how long to run the job before automatically cancelling + workspace: + clean: all + displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }}) + pool: ${{ parameters.iosPool }} + variables: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + steps: + - template: ui-tests-steps.yml + parameters: + platform: ios + ${{ if eq(version, 'latest') }}: + version: 16.4 + ${{ if ne(version, 'latest') }}: + version: ${{ version }} + path: ${{ project.ios }} + app: ${{ project.app }} + # yamllint disable-line rule:key-duplicates + ${{ if eq(version, 'latest') }}: + device: ios-simulator-64 + # yamllint disable-line rule:key-duplicates + ${{ if ne(version, 'latest') }}: + device: ios-simulator-64_${{ version }} + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - stage: winui_ui_tests displayName: WinUI UITests dependsOn: [] jobs: - ${{ each project in parameters.projects }}: - - ${{ if ne(project.winui, '') }}: + - ${{ if ne(project.winui, '') }}: - job: winui_ui_tests_${{ project.name }} - timeoutInMinutes: 240 # how long to run the job before automatically cancelling + timeoutInMinutes: 240 # how long to run the job before automatically cancelling workspace: clean: all displayName: ${{ coalesce(project.desc, project.name) }} @@ -116,7 +119,7 @@ stages: dependsOn: [] jobs: - ${{ each project in parameters.projects }}: - - ${{ if ne(project.mac, '') }}: + - ${{ if ne(project.mac, '') }}: - job: mac_ui_tests_${{ project.name }} timeoutInMinutes: 240 # how long to run the job before automatically cancelling workspace: @@ -136,73 +139,75 @@ stages: provisionatorChannel: ${{ parameters.provisionatorChannel }} agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - - ${{ if eq(parameters.runCompatibilityTests, true) }}: - - stage: android_compatibility_ui_tests - displayName: Android Compatibility UITests - dependsOn: [] - jobs: - - ${{ each project in parameters.projects }}: - - ${{ if ne(project.android, '') }}: - - ${{ each api in parameters.androidApiLevels }}: - - ${{ if not(containsValue(project.androidApiLevelsExclude, api)) }}: - - job: android_compatibility_ui_tests_${{ project.name }}_${{ api }} - timeoutInMinutes: 240 - workspace: - clean: all - displayName: ${{ coalesce(project.desc, project.name) }} (API ${{ api }}) - pool: ${{ parameters.androidCompatibilityPool }} - variables: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - steps: - - template: ui-tests-compatibility-steps.yml - parameters: - platform: android - provisionPlatform: macos - configuration: Debug - version: ${{ api }} - path: ${{ project.compatibilityAndroidTestProject }} - app: ${{ project.compatibilityAndroidApp }} - targetSample: "dotnet-legacy-controlgallery-android" - ${{ if eq(api, 27) }}: - DEVICE: android-emulator-32_${{ api }} - ${{ if not(eq(api, 27)) }}: - DEVICE: android-emulator-64_${{ api }} - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + - ${{ if eq(parameters.runCompatibilityTests, true) }}: + - stage: android_compatibility_ui_tests + displayName: Android Compatibility UITests + dependsOn: [] + jobs: + - ${{ each project in parameters.projects }}: + - ${{ if ne(project.android, '') }}: + - ${{ each api in parameters.androidApiLevels }}: + - ${{ if not(containsValue(project.androidApiLevelsExclude, api)) }}: + - job: android_compatibility_ui_tests_${{ project.name }}_${{ api }} + timeoutInMinutes: 240 + workspace: + clean: all + displayName: ${{ coalesce(project.desc, project.name) }} (API ${{ api }}) + pool: ${{ parameters.androidCompatibilityPool }} + variables: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + steps: + - template: ui-tests-compatibility-steps.yml + parameters: + platform: android + provisionPlatform: macos + configuration: Debug + version: ${{ api }} + path: ${{ project.compatibilityAndroidTestProject }} + app: ${{ project.compatibilityAndroidApp }} + targetSample: "dotnet-legacy-controlgallery-android" + ${{ if eq(api, 27) }}: + DEVICE: android-emulator-32_${{ api }} + ${{ if not(eq(api, 27)) }}: + DEVICE: android-emulator-64_${{ api }} + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} - - stage: ios_compatibility_ui_tests - displayName: iOS Compatibility UITests - dependsOn: [] - jobs: - - ${{ each project in parameters.projects }}: - - ${{ if ne(project.ios, '') }}: - - ${{ each version in parameters.iosVersions }}: - - ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: - - job: ios_compatibility_ui_tests_${{ project.name }}_${{ replace(version, '.', '_') }} - timeoutInMinutes: 240 - workspace: - clean: all - displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }}) - pool: ${{ parameters.iosCompatibilityPool }} - variables: - REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) - steps: - - template: ui-tests-compatibility-steps.yml - parameters: - platform: ios - provisionPlatform: macos - configuration: Debug - ${{ if eq(version, 'latest') }}: - version: 16.2 - ${{ if ne(version, 'latest') }}: - version: ${{ version }} - path: ${{ project.compatibilityiOSTestProject }} - app: ${{ project.compatibilityiOSApp }} - targetSample: "dotnet-legacy-controlgallery-ios" - ${{ if eq(version, 'latest') }}: - device: ios-simulator-64 - ${{ if ne(version, 'latest') }}: - device: ios-simulator-64_${{ version }} - provisionatorChannel: ${{ parameters.provisionatorChannel }} - agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} + - stage: ios_compatibility_ui_tests + displayName: iOS Compatibility UITests + dependsOn: [] + jobs: + - ${{ each project in parameters.projects }}: + - ${{ if ne(project.ios, '') }}: + - ${{ each version in parameters.iosVersions }}: + - ${{ if not(containsValue(project.iosVersionsExclude, version)) }}: + - job: ios_compatibility_ui_tests_${{ project.name }}_${{ replace(version, '.', '_') }} + timeoutInMinutes: 240 + workspace: + clean: all + displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }}) + pool: ${{ parameters.iosCompatibilityPool }} + variables: + REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE) + steps: + - template: ui-tests-compatibility-steps.yml + parameters: + platform: ios + provisionPlatform: macos + configuration: Debug + ${{ if eq(version, 'latest') }}: + version: 16.2 + ${{ if ne(version, 'latest') }}: + version: ${{ version }} + path: ${{ project.compatibilityiOSTestProject }} + app: ${{ project.compatibilityiOSApp }} + targetSample: "dotnet-legacy-controlgallery-ios" + # yamllint disable-line rule:key-duplicates + ${{ if eq(version, 'latest') }}: + device: ios-simulator-64 + # yamllint disable-line rule:key-duplicates + ${{ if ne(version, 'latest') }}: + device: ios-simulator-64_${{ version }} + provisionatorChannel: ${{ parameters.provisionatorChannel }} + agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }} diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index 53556c9d981a..d5c2e673f3a2 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -1,66 +1,66 @@ +# yamllint disable rule:line-length rule:document-start variables: -- name: BuildVersion - value: $[counter('buildversion-counter', 5000)] -- name: NUGET_VERSION - value: 6.4.0 -- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE - value: true -- name: DOTNET_VERSION - value: 8.0.101 -- name: REQUIRED_XCODE - value: 15.2.0 -- name: DEVICETESTS_REQUIRED_XCODE - value: 15.2.0 -- name: LocBranchPrefix - value: 'loc-hb' -- name: isMainBranch - value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')] -- name: isLocBranch - value: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/loc'), startsWith(variables['Build.SourceBranch'], 'refs/heads/loc-'))] -- name: isTargetMainBranch - value: $[eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/main')] -- name: isLocPRBranch - value: $[startsWith(variables['System.PullRequest.SourceBranch'], 'loc-hb')] -- name: isPullRequest - value: $[eq(variables['Build.Reason'], 'PullRequest')] -- name: isLocHandoffBranch - value: $[in(variables['Build.SourceBranch'], 'refs/heads/net9.0', 'refs/heads/net8.0', 'refs/heads/net7.0', 'refs/heads/main')] -- name: signingCondition - value: $[or( - eq(variables['Sign'], 'true'), - in(variables['Build.SourceBranch'], 'refs/heads/net9.0', 'refs/heads/net8.0', 'refs/heads/net7.0', 'refs/heads/main'), - startsWith(variables['Build.SourceBranch'], 'refs/tags/'), - startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') - )] -# Common Agent Pools in use -- name: LogDirectory - value: $(Build.ArtifactStagingDirectory)/logs -- name: TestResultsDirectory - value: $(Build.ArtifactStagingDirectory)/test-results -- name: skipProvisionator - value: $[ne(variables['provisioning'], 'true')] -- name: provisionator.xcode - value: 'eng/provisioning/xcode.csx' -- name: provisionator.path - value: 'eng/provisioning/provisioning.csx' -- name: provisionator.extraArguments - value: '-vvvv' -- name: DotNet.Dir - value: $(System.DefaultWorkingDirectory)/bin/dotnet -- name: DotNet.Path - value: $(System.DefaultWorkingDirectory)/bin/dotnet/dotnet -- name: TeamName - value: Maui -- name: POWERSHELL_VERSION - value: 7.4.0 -- name: Codeql.Enabled - value: false -- group: Xamarin-Secrets -# Variable groups required for private builds -# - ${{ if or(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.DefinitionName'], 'dotnet-maui')) }}: -# - name: PrivateBuild -# value: true -# # For eng/common/SetupNugetSources.ps1 -# - group: DotNetBuilds storage account read tokens -# - group: AzureDevOps-Artifact-Feeds-Pats - + - name: BuildVersion + value: $[counter('buildversion-counter', 5000)] + - name: NUGET_VERSION + value: 6.4.0 + - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE + value: true + - name: DOTNET_VERSION + value: 8.0.101 + - name: REQUIRED_XCODE + value: 15.2.0 + - name: DEVICETESTS_REQUIRED_XCODE + value: 15.2.0 + - name: LocBranchPrefix + value: 'loc-hb' + - name: isMainBranch + value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')] + - name: isLocBranch + value: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/loc'), startsWith(variables['Build.SourceBranch'], 'refs/heads/loc-'))] + - name: isTargetMainBranch + value: $[eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/main')] + - name: isLocPRBranch + value: $[startsWith(variables['System.PullRequest.SourceBranch'], 'loc-hb')] + - name: isPullRequest + value: $[eq(variables['Build.Reason'], 'PullRequest')] + - name: isLocHandoffBranch + value: $[in(variables['Build.SourceBranch'], 'refs/heads/net9.0', 'refs/heads/net8.0', 'refs/heads/net7.0', 'refs/heads/main')] + - name: signingCondition + value: $[or( + eq(variables['Sign'], 'true'), + in(variables['Build.SourceBranch'], 'refs/heads/net9.0', 'refs/heads/net8.0', 'refs/heads/net7.0', 'refs/heads/main'), + startsWith(variables['Build.SourceBranch'], 'refs/tags/'), + startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') + )] + # Common Agent Pools in use + - name: LogDirectory + value: $(Build.ArtifactStagingDirectory)/logs + - name: TestResultsDirectory + value: $(Build.ArtifactStagingDirectory)/test-results + - name: skipProvisionator + value: $[ne(variables['provisioning'], 'true')] + - name: provisionator.xcode + value: 'eng/provisioning/xcode.csx' + - name: provisionator.path + value: 'eng/provisioning/provisioning.csx' + - name: provisionator.extraArguments + value: '-vvvv' + - name: DotNet.Dir + value: $(System.DefaultWorkingDirectory)/bin/dotnet + - name: DotNet.Path + value: $(System.DefaultWorkingDirectory)/bin/dotnet/dotnet + - name: TeamName + value: Maui + - name: POWERSHELL_VERSION + value: 7.4.0 + - name: Codeql.Enabled + value: false + - group: Xamarin-Secrets + # Variable groups required for private builds + # - ${{ if or(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.DefinitionName'], 'dotnet-maui')) }}: + # - name: PrivateBuild + # value: true + # # For eng/common/SetupNugetSources.ps1 + # - group: DotNetBuilds storage account read tokens + # - group: AzureDevOps-Artifact-Feeds-Pats From c77eb84258c959b7bc686fa782797f6a72fa5a44 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Saenz Date: Wed, 20 Mar 2024 18:13:53 -0400 Subject: [PATCH 7/9] Write on PRs. --- .github/workflows/yamllint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 295b32794f03..7ba2e15686ca 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -5,6 +5,7 @@ on: pull_request # This action only need a single permission in order to autoformat the code. permissions: contents: read + pull-requests: write jobs: rebase: From b13f7f0aafc243fd0bddd1a0669a07f985e00643 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 21 Mar 2024 06:45:49 -0400 Subject: [PATCH 8/9] Remove yy comment. --- .github/workflows/yamllint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 7ba2e15686ca..da78ee9f7b43 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -2,7 +2,6 @@ name: PR yamllint check on: pull_request -# This action only need a single permission in order to autoformat the code. permissions: contents: read pull-requests: write From 691939da5588bd619bf14b1885cefc0854eb5132 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 21 Mar 2024 06:46:05 -0400 Subject: [PATCH 9/9] Remove yy comment. --- .github/workflows/yamllint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index da78ee9f7b43..1f5489da6309 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + fetch-depth: 0 - name: Install yamllint run: pip install yamllint