azure-pipelines-woa.yml 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. New-Item src\out\Default\gen\node_headers\Release -Type directory
  51. Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib
  52. displayName: 'Setup node headers'
  53. - script: |
  54. cd src
  55. set npm_config_nodedir=%cd%\out\Default\gen\node_headers
  56. set npm_config_arch=arm64
  57. cd electron
  58. # CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
  59. node script/yarn test -- --enable-logging --verbose --disable-features=CalculateNativeWinOcclusion
  60. displayName: 'Run Electron tests'
  61. env:
  62. ELECTRON_OUT_DIR: Default
  63. IGNORE_YARN_INSTALL_ERROR: 1
  64. ELECTRON_TEST_RESULTS_DIR: junit
  65. MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
  66. MOCHA_REPORTER: mocha-multi-reporters
  67. - task: PublishTestResults@2
  68. displayName: 'Publish Test Results'
  69. inputs:
  70. testResultsFiles: '*.xml'
  71. searchFolder: '$(System.DefaultWorkingDirectory)/src/junit/'
  72. condition: always()
  73. - script: |
  74. cd src
  75. echo "Verifying non proprietary ffmpeg"
  76. python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
  77. displayName: 'Verify ffmpeg'
  78. - powershell: |
  79. Get-Process | Where Name –Like "electron*" | Stop-Process
  80. Get-Process | Where Name –Like "msedge*" | Stop-Process
  81. displayName: 'Kill processes left running from last test run'
  82. condition: always()
  83. - powershell: |
  84. Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
  85. displayName: 'Delete user app data directories'
  86. condition: always()