pipeline-segment-node-nan-test.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. name: Pipeline Segment - Node/Nan Test
  2. on:
  3. workflow_call:
  4. inputs:
  5. target-platform:
  6. type: string
  7. description: 'Platform to run on, can be macos, win or linux'
  8. required: true
  9. target-arch:
  10. type: string
  11. description: 'Arch to build for, can be x64, arm64 or arm'
  12. required: true
  13. test-runs-on:
  14. type: string
  15. description: 'What host to run the tests on'
  16. required: true
  17. test-container:
  18. type: string
  19. description: 'JSON container information for aks runs-on'
  20. required: false
  21. default: '{"image":null}'
  22. gn-build-type:
  23. description: 'The gn build type - testing or release'
  24. required: true
  25. type: string
  26. default: testing
  27. concurrency:
  28. group: electron-node-nan-test-${{ inputs.target-platform }}-${{ inputs.target-arch }}-${{ github.ref_protected == true && github.run_id || github.ref }}
  29. cancel-in-progress: ${{ github.ref_protected != true }}
  30. env:
  31. CHROMIUM_GIT_COOKIE: ${{ secrets.CHROMIUM_GIT_COOKIE }}
  32. ELECTRON_OUT_DIR: Default
  33. ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
  34. jobs:
  35. node-tests:
  36. name: Run Node.js Tests
  37. runs-on: electron-arc-linux-amd64-8core
  38. timeout-minutes: 30
  39. env:
  40. TARGET_ARCH: ${{ inputs.target-arch }}
  41. BUILD_TYPE: linux
  42. container: ${{ fromJSON(inputs.test-container) }}
  43. steps:
  44. - name: Checkout Electron
  45. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
  46. with:
  47. path: src/electron
  48. fetch-depth: 0
  49. ref: ${{ github.event.pull_request.head.sha }}
  50. - name: Set Chromium Git Cookie
  51. uses: ./src/electron/.github/actions/set-chromium-cookie
  52. - name: Install Build Tools
  53. uses: ./src/electron/.github/actions/install-build-tools
  54. - name: Init Build Tools
  55. run: |
  56. e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
  57. - name: Install Dependencies
  58. uses: ./src/electron/.github/actions/install-dependencies
  59. - name: Download Generated Artifacts
  60. uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
  61. with:
  62. name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
  63. path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
  64. - name: Download Src Artifacts
  65. uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
  66. with:
  67. name: src_artifacts_linux_${{ env.TARGET_ARCH }}
  68. path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
  69. - name: Restore Generated Artifacts
  70. run: ./src/electron/script/actions/restore-artifacts.sh
  71. - name: Unzip Dist
  72. run: |
  73. cd src/out/Default
  74. unzip -:o dist.zip
  75. - name: Setup Linux for Headless Testing
  76. run: sh -e /etc/init.d/xvfb start
  77. - name: Run Node.js Tests
  78. run: |
  79. cd src
  80. node electron/script/node-spec-runner.js --default --jUnitDir=junit
  81. - name: Wait for active SSH sessions
  82. if: always() && !cancelled()
  83. shell: bash
  84. run: |
  85. while [ -f /var/.ssh-lock ]
  86. do
  87. sleep 60
  88. done
  89. nan-tests:
  90. name: Run Nan Tests
  91. runs-on: electron-arc-linux-amd64-4core
  92. timeout-minutes: 30
  93. env:
  94. TARGET_ARCH: ${{ inputs.target-arch }}
  95. BUILD_TYPE: linux
  96. container: ${{ fromJSON(inputs.test-container) }}
  97. steps:
  98. - name: Checkout Electron
  99. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
  100. with:
  101. path: src/electron
  102. fetch-depth: 0
  103. ref: ${{ github.event.pull_request.head.sha }}
  104. - name: Set Chromium Git Cookie
  105. uses: ./src/electron/.github/actions/set-chromium-cookie
  106. - name: Install Build Tools
  107. uses: ./src/electron/.github/actions/install-build-tools
  108. - name: Init Build Tools
  109. run: |
  110. e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }}
  111. - name: Install Dependencies
  112. uses: ./src/electron/.github/actions/install-dependencies
  113. - name: Download Generated Artifacts
  114. uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
  115. with:
  116. name: generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
  117. path: ./generated_artifacts_${{ env.BUILD_TYPE }}_${{ env.TARGET_ARCH }}
  118. - name: Download Src Artifacts
  119. uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
  120. with:
  121. name: src_artifacts_linux_${{ env.TARGET_ARCH }}
  122. path: ./src_artifacts_linux_${{ env.TARGET_ARCH }}
  123. - name: Restore Generated Artifacts
  124. run: ./src/electron/script/actions/restore-artifacts.sh
  125. - name: Unzip Dist
  126. run: |
  127. cd src/out/Default
  128. unzip -:o dist.zip
  129. - name: Setup Linux for Headless Testing
  130. run: sh -e /etc/init.d/xvfb start
  131. - name: Run Nan Tests
  132. run: |
  133. cd src
  134. node electron/script/nan-spec-runner.js
  135. - name: Wait for active SSH sessions
  136. shell: bash
  137. if: always() && !cancelled()
  138. run: |
  139. while [ -f /var/.ssh-lock ]
  140. do
  141. sleep 60
  142. done