Browse Source

Specify dotnet version in pipelines

flabbet 8 months ago
parent
commit
d67d2f74be
3 changed files with 118 additions and 102 deletions
  1. 56 51
      pipelines/Linux/tests-ubuntu.yml
  2. 56 51
      pipelines/MacOS/tests-macos.yml
  3. 6 0
      pipelines/Windows/tests-windows.yml

+ 56 - 51
pipelines/Linux/tests-ubuntu.yml

@@ -1,7 +1,7 @@
 trigger:
-- development
-- master
-- 2.0-cicd
+  - development
+  - master
+  - 2.0-cicd
 
 pool:
   vmImage: 'ubuntu-latest'
@@ -14,61 +14,66 @@ variables:
   wasiUrl: 'https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/$(wasiVer).tar.gz'
 
 steps:
-- task: CmdLine@2
-  displayName: 'Download WASI SDK'
-  inputs:
-    script: |
-      curl -L -o $(wasiVer).tar.gz $(wasiUrl)
+  - task: UseDotNet@2
+    displayName: 'Install .NET SDK'
+    inputs:
+      packageType: 'sdk'
+      version: '$(dotnetVersion)'
+  - task: CmdLine@2
+    displayName: 'Download WASI SDK'
+    inputs:
+      script: |
+        curl -L -o $(wasiVer).tar.gz $(wasiUrl)
 
-- task: CmdLine@2
-  displayName: 'Unpack WASI SDK'
-  inputs:
-    script: |
-      tar -xzf $(wasiVer).tar.gz
-      echo "Contents of directory after extraction:"
-      dir $(wasiVer)
+  - task: CmdLine@2
+    displayName: 'Unpack WASI SDK'
+    inputs:
+      script: |
+        tar -xzf $(wasiVer).tar.gz
+        echo "Contents of directory after extraction:"
+        dir $(wasiVer)
 
-- task: PowerShell@2
-  displayName: 'Set Environment Path for WASI SDK'
-  inputs:
-    targetType: 'inline'
-    script: |
-      $env:WASI_SDK_PATH = "$(Get-Location)\$(wasiVer)"
-      Write-Host "##vso[task.setvariable variable=WASI_SDK_PATH]$env:WASI_SDK_PATH"
+  - task: PowerShell@2
+    displayName: 'Set Environment Path for WASI SDK'
+    inputs:
+      targetType: 'inline'
+      script: |
+        $env:WASI_SDK_PATH = "$(Get-Location)\$(wasiVer)"
+        Write-Host "##vso[task.setvariable variable=WASI_SDK_PATH]$env:WASI_SDK_PATH"
 
-- task: PowerShell@2
-  displayName: 'Verify Environment Path'
-  inputs:
-    targetType: 'inline'
-    script: |
-      Write-Host "Environment path set to: $env:WASI_SDK_PATH"
+  - task: PowerShell@2
+    displayName: 'Verify Environment Path'
+    inputs:
+      targetType: 'inline'
+      script: |
+        Write-Host "Environment path set to: $env:WASI_SDK_PATH"
 
 
-- task: NuGetToolInstaller@1
+  - task: NuGetToolInstaller@1
 
-- task: DotNetCoreCLI@2
-  displayName: Install wasi-wasm
-  inputs:
-    command: 'custom'
-    custom: 'workload'
-    arguments: 'install wasi-experimental'
+  - task: DotNetCoreCLI@2
+    displayName: Install wasi-wasm
+    inputs:
+      command: 'custom'
+      custom: 'workload'
+      arguments: 'install wasi-experimental'
 
 
-- task: NuGetCommand@2
-  displayName: 'Restore solution'
-  inputs:
-    restoreSolution: '$(solution)'
+  - task: NuGetCommand@2
+    displayName: 'Restore solution'
+    inputs:
+      restoreSolution: '$(solution)'
 
-- task: DotNetCoreCLI@2
-  displayName: Build
-  inputs:
-    command: 'build'
-    projects: '**/*.csproj'
-    arguments: '--configuration Release -r $(buildPlatform)'
+  - task: DotNetCoreCLI@2
+    displayName: Build
+    inputs:
+      command: 'build'
+      projects: '**/*.csproj'
+      arguments: '--configuration Release -r $(buildPlatform)'
 
-- task: DotNetCoreCLI@2
-  displayName: Tests
-  inputs:
-    command: test
-    projects: '**/*Tests/*.csproj'
-    arguments: '--configuration $(buildConfiguration) -r $(buildPlatform)'
+  - task: DotNetCoreCLI@2
+    displayName: Tests
+    inputs:
+      command: test
+      projects: '**/*Tests/*.csproj'
+      arguments: '--configuration $(buildConfiguration) -r $(buildPlatform)'

+ 56 - 51
pipelines/MacOS/tests-macos.yml

@@ -1,7 +1,7 @@
 trigger:
-- development
-- master
-- 2.0-cicd
+  - development
+  - master
+  - 2.0-cicd
 
 pool:
   vmImage: 'macos-latest'
@@ -14,61 +14,66 @@ variables:
   wasiUrl: 'https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/$(wasiVer).tar.gz'
 
 steps:
-- task: CmdLine@2
-  displayName: 'Download WASI SDK'
-  inputs:
-    script: |
-      curl -L -o $(wasiVer).tar.gz $(wasiUrl)
+  - task: UseDotNet@2
+    displayName: 'Install .NET SDK'
+    inputs:
+      packageType: 'sdk'
+      version: '$(dotnetVersion)'
+  - task: CmdLine@2
+    displayName: 'Download WASI SDK'
+    inputs:
+      script: |
+        curl -L -o $(wasiVer).tar.gz $(wasiUrl)
 
-- task: CmdLine@2
-  displayName: 'Unpack WASI SDK'
-  inputs:
-    script: |
-      tar -xzf $(wasiVer).tar.gz
-      echo "Contents of directory after extraction:"
-      dir $(wasiVer)
+  - task: CmdLine@2
+    displayName: 'Unpack WASI SDK'
+    inputs:
+      script: |
+        tar -xzf $(wasiVer).tar.gz
+        echo "Contents of directory after extraction:"
+        dir $(wasiVer)
 
-- task: PowerShell@2
-  displayName: 'Set Environment Path for WASI SDK'
-  inputs:
-    targetType: 'inline'
-    script: |
-      $env:WASI_SDK_PATH = "$(Get-Location)\$(wasiVer)"
-      Write-Host "##vso[task.setvariable variable=WASI_SDK_PATH]$env:WASI_SDK_PATH"
+  - task: PowerShell@2
+    displayName: 'Set Environment Path for WASI SDK'
+    inputs:
+      targetType: 'inline'
+      script: |
+        $env:WASI_SDK_PATH = "$(Get-Location)\$(wasiVer)"
+        Write-Host "##vso[task.setvariable variable=WASI_SDK_PATH]$env:WASI_SDK_PATH"
 
-- task: PowerShell@2
-  displayName: 'Verify Environment Path'
-  inputs:
-    targetType: 'inline'
-    script: |
-      Write-Host "Environment path set to: $env:WASI_SDK_PATH"
+  - task: PowerShell@2
+    displayName: 'Verify Environment Path'
+    inputs:
+      targetType: 'inline'
+      script: |
+        Write-Host "Environment path set to: $env:WASI_SDK_PATH"
 
 
-- task: NuGetToolInstaller@1
+  - task: NuGetToolInstaller@1
 
-- task: DotNetCoreCLI@2
-  displayName: Install wasi-wasm
-  inputs:
-    command: 'custom'
-    custom: 'workload'
-    arguments: 'install wasi-experimental'
+  - task: DotNetCoreCLI@2
+    displayName: Install wasi-wasm
+    inputs:
+      command: 'custom'
+      custom: 'workload'
+      arguments: 'install wasi-experimental'
 
 
-- task: NuGetCommand@2
-  displayName: 'Restore solution'
-  inputs:
-    restoreSolution: '$(solution)'
+  - task: NuGetCommand@2
+    displayName: 'Restore solution'
+    inputs:
+      restoreSolution: '$(solution)'
 
-- task: DotNetCoreCLI@2
-  displayName: Build
-  inputs:
-    command: 'build'
-    projects: '**/*.csproj'
-    arguments: '--configuration Release -r $(buildPlatform)'
+  - task: DotNetCoreCLI@2
+    displayName: Build
+    inputs:
+      command: 'build'
+      projects: '**/*.csproj'
+      arguments: '--configuration Release -r $(buildPlatform)'
 
-- task: DotNetCoreCLI@2
-  displayName: Tests
-  inputs:
-    command: test
-    projects: '**/*Tests/*.csproj'
-    arguments: '--configuration $(buildConfiguration) -r $(buildPlatform)'
+  - task: DotNetCoreCLI@2
+    displayName: Tests
+    inputs:
+      command: test
+      projects: '**/*Tests/*.csproj'
+      arguments: '--configuration $(buildConfiguration) -r $(buildPlatform)'

+ 6 - 0
pipelines/Windows/tests-windows.yml

@@ -14,6 +14,12 @@ variables:
   wasiUrl: 'https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/$(wasiVer).tar.gz'
 
 steps:
+- task: UseDotNet@2
+  displayName: 'Install .NET SDK'
+  inputs:
+    packageType: 'sdk'
+    version: '$(dotnetVersion)'
+    
 - task: CmdLine@2
   displayName: 'Download WASI SDK'
   inputs: