tests-macos.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. trigger:
  2. - development
  3. - master
  4. - 2.0-cicd
  5. pool:
  6. vmImage: 'macos-latest'
  7. variables:
  8. solution: '**/*.sln'
  9. buildPlatform: 'osx-$(arch)'
  10. buildConfiguration: 'Release'
  11. wasiVer: 'wasi-sdk-24.0-$(wasi-arch)-macos'
  12. wasiUrl: 'https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/$(wasiVer).tar.gz'
  13. steps:
  14. - task: CmdLine@2
  15. displayName: 'Download WASI SDK'
  16. inputs:
  17. script: |
  18. curl -L -o $(wasiVer).tar.gz $(wasiUrl)
  19. - task: CmdLine@2
  20. displayName: 'Unpack WASI SDK'
  21. inputs:
  22. script: |
  23. tar -xzf $(wasiVer).tar.gz
  24. echo "Contents of directory after extraction:"
  25. dir $(wasiVer)
  26. - task: PowerShell@2
  27. displayName: 'Set Environment Path for WASI SDK'
  28. inputs:
  29. targetType: 'inline'
  30. script: |
  31. $env:WASI_SDK_PATH = "$(Get-Location)\$(wasiVer)"
  32. Write-Host "##vso[task.setvariable variable=WASI_SDK_PATH]$env:WASI_SDK_PATH"
  33. - task: PowerShell@2
  34. displayName: 'Verify Environment Path'
  35. inputs:
  36. targetType: 'inline'
  37. script: |
  38. Write-Host "Environment path set to: $env:WASI_SDK_PATH"
  39. - task: NuGetToolInstaller@1
  40. - task: DotNetCoreCLI@2
  41. displayName: Install wasi-wasm
  42. inputs:
  43. command: 'custom'
  44. custom: 'workload'
  45. arguments: 'install wasi-experimental'
  46. - task: NuGetCommand@2
  47. displayName: 'Restore solution'
  48. inputs:
  49. restoreSolution: '$(solution)'
  50. - task: DotNetCoreCLI@2
  51. displayName: Build
  52. inputs:
  53. command: 'build'
  54. projects: '**/*.csproj'
  55. arguments: '--configuration Release -r $(buildPlatform)'
  56. - task: DotNetCoreCLI@2
  57. displayName: Tests
  58. inputs:
  59. command: test
  60. projects: '**/*Tests/*.csproj'
  61. arguments: '--configuration $(buildConfiguration) -r $(buildPlatform)'