build.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. name: Build
  2. on:
  3. push:
  4. branches: main
  5. pull_request:
  6. branches: '*'
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@v2
  13. - name: Base Setup
  14. uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
  15. - name: Install dependencies
  16. run: python -m pip install -U jupyterlab~=3.1 check-manifest
  17. - name: Lint the extension
  18. run: |
  19. set -eux
  20. jlpm
  21. jlpm run lint:check
  22. - name: Test the extension
  23. run: |
  24. set -eux
  25. jlpm run test
  26. - name: Build the extension
  27. run: |
  28. set -eux
  29. python -m pip install .[test]
  30. jupyter labextension list
  31. jupyter labextension list 2>&1 | grep -ie "yili-dag.*OK"
  32. python -m jupyterlab.browser_check
  33. - name: Package the extension
  34. run: |
  35. set -eux
  36. check-manifest -v
  37. pip install build
  38. python -m build
  39. pip uninstall -y "yili-dag" jupyterlab
  40. - name: Upload extension packages
  41. uses: actions/upload-artifact@v2
  42. with:
  43. name: extension-artifacts
  44. path: dist/yili-dag*
  45. if-no-files-found: error
  46. test_isolated:
  47. needs: build
  48. runs-on: ubuntu-latest
  49. steps:
  50. - name: Checkout
  51. uses: actions/checkout@v2
  52. - name: Install Python
  53. uses: actions/setup-python@v2
  54. with:
  55. python-version: '3.9'
  56. architecture: 'x64'
  57. - uses: actions/download-artifact@v2
  58. with:
  59. name: extension-artifacts
  60. - name: Install and Test
  61. run: |
  62. set -eux
  63. # Remove NodeJS, twice to take care of system and locally installed node versions.
  64. sudo rm -rf $(which node)
  65. sudo rm -rf $(which node)
  66. pip install "jupyterlab~=3.1" yili-dag*.whl
  67. jupyter labextension list
  68. jupyter labextension list 2>&1 | grep -ie "yili-dag.*OK"
  69. python -m jupyterlab.browser_check --no-chrome-test
  70. integration-tests:
  71. name: Integration tests
  72. needs: build
  73. runs-on: ubuntu-latest
  74. env:
  75. PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
  76. steps:
  77. - name: Checkout
  78. uses: actions/checkout@v2
  79. - name: Base Setup
  80. uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
  81. - name: Download extension package
  82. uses: actions/download-artifact@v2
  83. with:
  84. name: extension-artifacts
  85. - name: Install the extension
  86. run: |
  87. set -eux
  88. python -m pip install "jupyterlab~=3.1" yili-dag*.whl
  89. - name: Install dependencies
  90. working-directory: ui-tests
  91. env:
  92. PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
  93. run: jlpm install
  94. - name: Set up browser cache
  95. uses: actions/cache@v2
  96. with:
  97. path: |
  98. ${{ github.workspace }}/pw-browsers
  99. key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
  100. - name: Install browser
  101. run: jlpm playwright install chromium
  102. working-directory: ui-tests
  103. - name: Execute integration tests
  104. working-directory: ui-tests
  105. run: |
  106. jlpm playwright test
  107. - name: Upload Playwright Test report
  108. if: always()
  109. uses: actions/upload-artifact@v2
  110. with:
  111. name: yili-dag-playwright-tests
  112. path: |
  113. ui-tests/test-results
  114. ui-tests/playwright-report