azure-pipelines-woa.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. steps:
  2. - task: CopyFiles@2
  3. displayName: 'Copy Files to: src\electron'
  4. inputs:
  5. TargetFolder: src\electron
  6. - script: |
  7. cd src\electron
  8. node script/yarn.js install --frozen-lockfile
  9. displayName: 'Yarn install'
  10. - powershell: |
  11. $localArtifactPath = "$pwd\dist.zip"
  12. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/dist.zip"
  13. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  14. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\Default -y $localArtifactPath
  15. displayName: 'Download and extract dist.zip for test'
  16. env:
  17. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  18. - powershell: |
  19. $localArtifactPath = "$pwd\src\out\Default\shell_browser_ui_unittests.exe"
  20. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/shell_browser_ui_unittests.exe"
  21. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  22. displayName: 'Download and extract native test executables for test'
  23. env:
  24. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  25. - powershell: |
  26. $localArtifactPath = "$pwd\ffmpeg.zip"
  27. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/ffmpeg.zip"
  28. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  29. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\ffmpeg $localArtifactPath
  30. displayName: 'Download and extract ffmpeg.zip for test'
  31. env:
  32. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  33. - powershell: |
  34. $localArtifactPath = "$pwd\src\node_headers.zip"
  35. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip"
  36. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  37. cd src
  38. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip
  39. displayName: 'Download node headers for test'
  40. env:
  41. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  42. - powershell: |
  43. $localArtifactPath = "$pwd\src\out\Default\electron.lib"
  44. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/electron.lib"
  45. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  46. displayName: 'Download electron.lib for test'
  47. env:
  48. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  49. - powershell: |
  50. try {
  51. $localArtifactPath = "$pwd\src\pdb.zip"
  52. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/pdb.zip"
  53. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  54. cd src
  55. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
  56. } catch {
  57. Write-Host "There was an exception encountered while downloading pdb files:" $_.Exception.Message
  58. } finally {
  59. $global:LASTEXITCODE = 0
  60. }
  61. displayName: 'Download pdb files for detailed stacktraces'
  62. env:
  63. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  64. - powershell: |
  65. New-Item src\out\Default\gen\node_headers\Release -Type directory
  66. Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib
  67. displayName: 'Setup node headers'
  68. - script: |
  69. cd src
  70. set npm_config_nodedir=%cd%\out\Default\gen\node_headers
  71. set npm_config_arch=arm64
  72. cd electron
  73. node script/yarn test --runners=main --runTestFilesSeperately --enable-logging --disable-features=CalculateNativeWinOcclusion
  74. displayName: 'Run Electron Main process tests'
  75. env:
  76. ELECTRON_ENABLE_STACK_DUMPING: true
  77. ELECTRON_OUT_DIR: Default
  78. IGNORE_YARN_INSTALL_ERROR: 1
  79. ELECTRON_TEST_RESULTS_DIR: junit
  80. MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
  81. MOCHA_REPORTER: mocha-multi-reporters
  82. - script: |
  83. cd src
  84. set npm_config_nodedir=%cd%\out\Default\gen\node_headers
  85. set npm_config_arch=arm64
  86. cd electron
  87. node script/yarn test --runners=remote --enable-logging --disable-features=CalculateNativeWinOcclusion
  88. displayName: 'Run Electron Remote based tests'
  89. env:
  90. ELECTRON_OUT_DIR: Default
  91. IGNORE_YARN_INSTALL_ERROR: 1
  92. ELECTRON_TEST_RESULTS_DIR: junit
  93. MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
  94. MOCHA_REPORTER: mocha-multi-reporters
  95. condition: always()
  96. - task: PublishTestResults@2
  97. displayName: 'Publish Test Results'
  98. inputs:
  99. testResultsFiles: '*.xml'
  100. searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
  101. condition: always()
  102. - script: |
  103. cd src
  104. echo "Verifying non proprietary ffmpeg"
  105. python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
  106. displayName: 'Verify ffmpeg'
  107. - powershell: |
  108. Get-Process | Where Name –Like "electron*" | Stop-Process
  109. Get-Process | Where Name –Like "msedge*" | Stop-Process
  110. displayName: 'Kill processes left running from last test run'
  111. condition: always()
  112. - powershell: |
  113. Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
  114. displayName: 'Delete user app data directories'
  115. condition: always()