azure-pipelines-woa.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. $localArtifactPath = "$pwd\src\pdb.zip"
  51. $serverArtifactPath = "$env:APPVEYOR_URL/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/pdb.zip"
  52. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer $env:APPVEYOR_TOKEN" }
  53. cd src
  54. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
  55. displayName: 'Download pdb files for detailed stacktraces'
  56. env:
  57. APPVEYOR_TOKEN: $(APPVEYOR_TOKEN)
  58. - powershell: |
  59. New-Item src\out\Default\gen\node_headers\Release -Type directory
  60. Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib
  61. displayName: 'Setup node headers'
  62. - script: |
  63. cd src
  64. set npm_config_nodedir=%cd%\out\Default\gen\node_headers
  65. set npm_config_arch=arm64
  66. cd electron
  67. node script/yarn test --runners=main --runTestFilesSeperately --enable-logging --disable-features=CalculateNativeWinOcclusion
  68. displayName: 'Run Electron Main process tests'
  69. env:
  70. ELECTRON_ENABLE_STACK_DUMPING: true
  71. ELECTRON_OUT_DIR: Default
  72. IGNORE_YARN_INSTALL_ERROR: 1
  73. ELECTRON_TEST_RESULTS_DIR: junit
  74. MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
  75. MOCHA_REPORTER: mocha-multi-reporters
  76. - script: |
  77. cd src
  78. set npm_config_nodedir=%cd%\out\Default\gen\node_headers
  79. set npm_config_arch=arm64
  80. cd electron
  81. node script/yarn test --runners=remote --enable-logging --disable-features=CalculateNativeWinOcclusion
  82. displayName: 'Run Electron Remote based tests'
  83. env:
  84. ELECTRON_OUT_DIR: Default
  85. IGNORE_YARN_INSTALL_ERROR: 1
  86. ELECTRON_TEST_RESULTS_DIR: junit
  87. MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
  88. MOCHA_REPORTER: mocha-multi-reporters
  89. condition: always()
  90. - task: PublishTestResults@2
  91. displayName: 'Publish Test Results'
  92. inputs:
  93. testResultsFiles: '*.xml'
  94. searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
  95. condition: always()
  96. - script: |
  97. cd src
  98. echo "Verifying non proprietary ffmpeg"
  99. python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
  100. displayName: 'Verify ffmpeg'
  101. - powershell: |
  102. Get-Process | Where Name –Like "electron*" | Stop-Process
  103. Get-Process | Where Name –Like "msedge*" | Stop-Process
  104. displayName: 'Kill processes left running from last test run'
  105. condition: always()
  106. - powershell: |
  107. Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
  108. displayName: 'Delete user app data directories'
  109. condition: always()