Skip to content

Commit

Permalink
[ci] Add install-global-tool yaml template (#8233)
Browse files Browse the repository at this point in the history
Attempts to install the boots global tool have been failing:

    "C:\Program Files\dotnet\dotnet.exe" tool update boots -g --version 1.1.0.36 --add-source https://api.nuget.org/v3/index.json
    The requested version 1.1.0.36 is lower than existing version 1.1.0.712-preview2.

Fix this by replacing the install-apkdiff and install-dotnet-test-slicer
templates with a generic install-global-tool template that is also used
to install boots.
  • Loading branch information
pjcollins authored Aug 1, 2023
1 parent 964d2a2 commit 80a4716
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 39 deletions.
5 changes: 4 additions & 1 deletion build-tools/automation/yaml-templates/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ stages:
displayName: Build Solution
continueOnError: false

- template: install-apkdiff.yaml
- template: install-global-tool.yaml
parameters:
toolName: apkdiff
version: $(ApkDiffToolVersion)

- template: run-nunit-tests.yaml
parameters:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
parameters:
version: '0.0.15'
toolName: ''
version: ''
condition: succeeded()
continueOnError: true

steps:
- powershell: dotnet tool uninstall apkdiff -g
displayName: uninstall apkdiff
- powershell: dotnet tool uninstall ${{ parameters.toolName }} -g
displayName: uninstall ${{ parameters.toolName }}
ignoreLASTEXITCODE: true
condition: ${{ parameters.condition }}

- task: DotNetCoreCLI@2
displayName: install apkdiff ${{ parameters.version }}
displayName: install ${{ parameters.toolName }} ${{ parameters.version }}
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
inputs:
command: custom
custom: tool
arguments: >-
update apkdiff -g
update ${{ parameters.toolName }} -g
--version ${{ parameters.version }}
--add-source "https://api.nuget.org/v3/index.json"
24 changes: 13 additions & 11 deletions build-tools/automation/yaml-templates/setup-test-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,11 @@ steps:
xaSourcePath: ${{ parameters.xaSourcePath }}

- ${{ if eq(parameters.installLegacyXamarinAndroid, true) }}:
- task: DotNetCoreCLI@2
displayName: install boots 1.1.0.36
inputs:
command: custom
custom: tool
arguments: >-
update boots -g
--version 1.1.0.36
--add-source "https://api.nuget.org/v3/index.json"
- template: install-global-tool.yaml
parameters:
toolName: boots
version: $(BootsToolVersion)
continueOnError: false
- powershell: boots --stable Xamarin.Android
displayName: install Xamarin.Android stable

Expand Down Expand Up @@ -120,7 +116,13 @@ steps:
arguments: -t:ExtractWorkloadPacks -c ${{ parameters.configuration }} -v:n -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/extract-workloads.binlog

- ${{ if eq(parameters.installApkDiff, true) }}:
- template: install-apkdiff.yaml
- template: install-global-tool.yaml
parameters:
toolName: apkdiff
version: $(ApkDiffToolVersion)

- ${{ if eq(parameters.installTestSlicer, true) }}:
- template: install-dotnet-test-slicer.yaml
- template: install-global-tool.yaml
parameters:
toolName: dotnet-test-slicer
version: $(TestSlicerToolVersion)
6 changes: 6 additions & 0 deletions build-tools/automation/yaml-templates/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ variables:
value: test-assemblies
- name: WindowsToolchainPdbArtifactName
value: windows-toolchain-pdb
- name: ApkDiffToolVersion
value: 0.0.15
- name: TestSlicerToolVersion
value: 0.1.0-alpha5
- name: BootsToolVersion
value: 1.1.0.36
- name: NUnitConsoleVersion
value: 3.16.3
- name: NUnit.NumberOfTestWorkers
Expand Down

0 comments on commit 80a4716

Please sign in to comment.