electron_woa_testing.yml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. name: Electron WOA Testing
  2. on:
  3. push:
  4. branches: '**'
  5. workflow_dispatch:
  6. inputs:
  7. appveyor_job_id:
  8. description: 'Job Id of Appveyor WOA job to test'
  9. type: text
  10. required: true
  11. jobs:
  12. electron-woa-init:
  13. if: ${{ github.event_name == 'push' && github.repository == 'electron/electron' }}
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Dummy step for push event
  17. run: |
  18. echo "This job is a needed initialization step for Electron WOA testing. Another test result will appear once the electron-woa-testing build is done."
  19. electron-woa-testing:
  20. if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'electron/electron' }}
  21. runs-on: [self-hosted, woa]
  22. permissions:
  23. checks: write
  24. pull-requests: write
  25. steps:
  26. - uses: LouisBrunner/[email protected]
  27. with:
  28. token: ${{ secrets.GITHUB_TOKEN }}
  29. name: electron-woa-testing
  30. status: in_progress
  31. details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  32. output: |
  33. {"summary":"Test In Progress","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  34. - name: Clean Workspace
  35. run: |
  36. Remove-Item * -Recurse -Force
  37. shell: powershell
  38. - name: Checkout
  39. uses: actions/checkout@v3
  40. with:
  41. path: src\electron
  42. fetch-depth: 0
  43. - name: Yarn install
  44. run: |
  45. cd src\electron
  46. node script/yarn.js install --frozen-lockfile
  47. - name: Download and extract dist.zip for test
  48. run: |
  49. $localArtifactPath = "$pwd\dist.zip"
  50. $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/dist.zip"
  51. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
  52. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\Default -y $localArtifactPath
  53. shell: powershell
  54. - name: Download and extract native test executables for test
  55. run: |
  56. $localArtifactPath = "src\out\Default\shell_browser_ui_unittests.exe"
  57. $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/shell_browser_ui_unittests.exe"
  58. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
  59. shell: powershell
  60. - name: Download and extract ffmpeg.zip for test
  61. run: |
  62. $localArtifactPath = "$pwd\ffmpeg.zip"
  63. $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/ffmpeg.zip"
  64. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
  65. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -osrc\out\ffmpeg $localArtifactPath
  66. shell: powershell
  67. - name: Download node headers for test
  68. run: |
  69. $localArtifactPath = "src\node_headers.zip"
  70. $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/node_headers.zip"
  71. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
  72. cd src
  73. & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y node_headers.zip
  74. shell: powershell
  75. - name: Download electron.lib for test
  76. run: |
  77. $localArtifactPath = "src\out\Default\electron.lib"
  78. $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/electron.lib"
  79. Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
  80. shell: powershell
  81. # Uncomment the following block if pdb files are needed to debug issues
  82. # - name: Download pdb files for detailed stacktraces
  83. # if: ${{ github.event_name == 'workflow_dispatch' }}
  84. # run: |
  85. # try {
  86. # $localArtifactPath = "src\pdb.zip"
  87. # $serverArtifactPath = "https://ci.appveyor.com/api/buildjobs/${{ inputs.appveyor_job_id }}/artifacts/pdb.zip"
  88. # Invoke-RestMethod -Method Get -Uri $serverArtifactPath -OutFile $localArtifactPath -Headers @{ "Authorization" = "Bearer ${{ secrets.APPVEYOR_TOKEN }}" }
  89. # cd src
  90. # & "${env:ProgramFiles(x86)}\7-Zip\7z.exe" x -y pdb.zip
  91. # } catch {
  92. # Write-Host "There was an exception encountered while downloading pdb files:" $_.Exception.Message
  93. # } finally {
  94. # $global:LASTEXITCODE = 0
  95. # }
  96. # shell: powershell
  97. - name: Setup node headers
  98. run: |
  99. New-Item src\out\Default\gen\node_headers\Release -Type directory
  100. Copy-Item -path src\out\Default\electron.lib -destination src\out\Default\gen\node_headers\Release\node.lib
  101. shell: powershell
  102. - name: Run Electron Main process tests
  103. run: |
  104. cd src
  105. set npm_config_nodedir=%cd%\out\Default\gen\node_headers
  106. set npm_config_arch=arm64
  107. cd electron
  108. node script/yarn test --runners=main --enable-logging --disable-features=CalculateNativeWinOcclusion
  109. env:
  110. ELECTRON_ENABLE_STACK_DUMPING: true
  111. ELECTRON_OUT_DIR: Default
  112. IGNORE_YARN_INSTALL_ERROR: 1
  113. ELECTRON_TEST_RESULTS_DIR: junit
  114. MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
  115. MOCHA_REPORTER: mocha-multi-reporters
  116. ELECTRON_SKIP_NATIVE_MODULE_TESTS: true
  117. - name: Verify ffmpeg
  118. run: |
  119. cd src
  120. echo "Verifying non proprietary ffmpeg"
  121. python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
  122. shell: cmd
  123. - name: Kill processes left running from last test run
  124. if: ${{ always() }}
  125. run: |
  126. Get-Process | Where Name -Like "electron*" | Stop-Process
  127. Get-Process | Where Name -Like "msedge*" | Stop-Process
  128. shell: powershell
  129. - name: Delete user app data directories
  130. if: ${{ always() }}
  131. run: |
  132. Remove-Item -path $env:APPDATA/Electron* -Recurse -Force -ErrorAction Ignore
  133. shell: powershell
  134. - uses: LouisBrunner/[email protected]
  135. if: ${{ success() }}
  136. with:
  137. token: ${{ secrets.GITHUB_TOKEN }}
  138. name: electron-woa-testing
  139. conclusion: "${{ job.status }}"
  140. details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  141. output: |
  142. {"summary":"${{ job.status }}","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  143. - uses: LouisBrunner/[email protected]
  144. if: ${{ success() }}
  145. with:
  146. token: ${{ secrets.GITHUB_TOKEN }}
  147. name: electron-woa-testing
  148. conclusion: "${{ job.status }}"
  149. details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  150. output: |
  151. {"summary":"Job Succeeded","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  152. - uses: LouisBrunner/[email protected]
  153. if: ${{ ! success() }}
  154. with:
  155. token: ${{ secrets.GITHUB_TOKEN }}
  156. name: electron-woa-testing
  157. conclusion: "${{ job.status }}"
  158. details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  159. output: |
  160. {"summary":"Job Failed","text_description":"See job details here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}