Skip to content

Commit

Permalink
Add templates for installing the 32 bit .NET SDKs
Browse files Browse the repository at this point in the history
Install the x86 SDKs in Windows integration tests
  • Loading branch information
andrewlock committed Jun 30, 2021
1 parent 05dab87 commit 7a73ce3
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .azure-pipelines/steps/install-dotnet-5-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
parameters:
- name: includeX86
type: boolean
default: false

steps:
- task: UseDotNet@2
displayName: install dotnet core sdk 5
inputs:
packageType: sdk
version: $(dotnetCoreSdk5Version)
includePreviewVersions: true
includePreviewVersions: true

- ${{ if eq(parameters.includeX86, true) }}:
- template: install-dotnet-sdk-32bit.yml
parameters:
sdkVersion: $(dotnetCoreSdk5Version)
30 changes: 30 additions & 0 deletions .azure-pipelines/steps/install-dotnet-sdk-32bit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
parameters:
- name: sdkVersion
type: string
default: ''

- name: channel
type: string
default: ''

steps:
- ${{if ne(parameters.sdkVersion, '') }}:
- powershell: |
echo "Downloading dotnet-install.ps1"
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
$path = "C:\Users\VssAdministrator\AppData\Local\Microsoft\dotnet_32"
echo "Installing dotnet (x86) to $path"
./dotnet-install.ps1 -version ${{ parameters.sdkVersion }} -Architecture x86 -NoPath -InstallDir $path
echo "Exporting path to DOTNET_EXE_32"
echo "##vso[task.setvariable variable=DOTNET_EXE_32]$path\dotnet.exe"
displayName: install dotnet core sdk ${{ parameters.sdkVersion }} (x86)
- ${{if ne(parameters.channel, '') }}:
- powershell: |
echo "Downloading dotnet-install.ps1"
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
$path = "C:\Users\VssAdministrator\AppData\Local\Microsoft\dotnet_32"
echo "Installing dotnet (x86) to $path"
./dotnet-install.ps1 -Channel ${{ parameters.channel }} -Architecture x86 -NoPath -InstallDir $path
echo "Exporting path to DOTNET_EXE_32"
echo "##vso[task.setvariable variable=DOTNET_EXE_32]$path\dotnet.exe"
displayName: install dotnet core sdk ${{ parameters.channel }} (x86)
21 changes: 20 additions & 1 deletion .azure-pipelines/steps/install-dotnet-sdks.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
parameters:
- name: includeX86
type: boolean
default: false

steps:
- task: UseDotNet@2
displayName: install dotnet core sdk 2.1
Expand All @@ -22,4 +27,18 @@ steps:
inputs:
packageType: sdk
version: $(dotnetCoreSdk5Version)
includePreviewVersions: true
includePreviewVersions: true

- ${{ if eq(parameters.includeX86, true) }}:
- template: install-dotnet-sdk-32bit.yml
parameters:
channel: 2.1
- template: install-dotnet-sdk-32bit.yml
parameters:
channel: 3.0
- template: install-dotnet-sdk-32bit.yml
parameters:
channel: 3.1
- template: install-dotnet-sdk-32bit.yml
parameters:
sdkVersion: $(dotnetCoreSdk5Version)
4 changes: 4 additions & 0 deletions .azure-pipelines/ultimate-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ stages:

steps:
- template: steps/install-dotnet-sdks.yml
parameters:
includeX86: true
- template: steps/restore-working-directory.yml

- powershell: |
Expand Down Expand Up @@ -353,6 +355,8 @@ stages:
steps:

- template: steps/install-dotnet-sdks.yml
parameters:
includeX86: true
- template: steps/restore-working-directory.yml

- task: DownloadPipelineArtifact@2
Expand Down

0 comments on commit 7a73ce3

Please sign in to comment.