azure-pipelines-woa.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. workspace:
  2. clean: all
  3. steps:
  4. - checkout: self
  5. path: src\electron
  6. - script: |
  7. node script/yarn.js install --frozen-lockfile
  8. displayName: 'Yarn install'
  9. - powershell: |
  10. $localArtifactPath = "$pwd\dist.zip"
  11. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/dist.zip"
  12. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  13. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -o$(Pipeline.Workspace)\src\out\Default -y $localArtifactPath
  14. displayName: 'Download and extract dist.zip for test'
  15. env:
  16. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  17. - powershell: |
  18. $localArtifactPath = "$(Pipeline.Workspace)\src\out\Default\shell_browser_ui_unittests.exe"
  19. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/shell_browser_ui_unittests.exe"
  20. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  21. displayName: 'Download and extract native test executables for test'
  22. env:
  23. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  24. - powershell: |
  25. $localArtifactPath = "$pwd\ffmpeg.zip"
  26. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/ffmpeg.zip"
  27. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  28. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -o$(Pipeline.Workspace)\src\out\ffmpeg $localArtifactPath
  29. displayName: 'Download and extract ffmpeg.zip for test'
  30. env:
  31. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  32. - powershell: |
  33. $localArtifactPath = "$(Pipeline.Workspace)\src\node_headers.zip"
  34. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/node_headers.zip"
  35. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  36. cd $(Pipeline.Workspace)\src
  37. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip
  38. displayName: 'Download node headers for test'
  39. env:
  40. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  41. - powershell: |
  42. $localArtifactPath = "$(Pipeline.Workspace)\src\out\Default\electron.lib"
  43. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/electron.lib"
  44. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  45. displayName: 'Download electron.lib for test'
  46. env:
  47. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  48. # Uncomment the following block if pdb files are needed to debug issues
  49. # - powershell: |
  50. # try {
  51. # $localArtifactPath = "$(Pipeline.Workspace)\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 $(Pipeline.Workspace)\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 $(Pipeline.Workspace)\src\out\Default\gen\node_headers\Release -Type directory
  66. Copy-Item -path $(Pipeline.Workspace)\src\out\Default\electron.lib -destination $(Pipeline.Workspace)\src\out\Default\gen\node_headers\Release\node.lib
  67. displayName: 'Setup node headers'
  68. - script: |
  69. cd $(Pipeline.Workspace)\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 --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 $(Pipeline.Workspace)\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: succeededOrFailed()
  96. - task: PublishTestResults@2
  97. displayName: 'Publish Test Results'
  98. inputs:
  99. testResultsFiles: '*.xml'
  100. searchFolder: '$(Pipeline.Workspace)/src/junit/'
  101. condition: always()
  102. - script: |
  103. cd $(Pipeline.Workspace)\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()