partial-tests.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. name: Partial Tests Workflow
  2. on:
  3. workflow_call:
  4. env:
  5. NODE_OPTIONS: --max-old-space-size=4096
  6. jobs:
  7. linter:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v4
  11. - uses: jpetrucciani/mypy-check@master
  12. with:
  13. mypy_flags: "--ignore-missing-imports --implicit-optional --disable-error-code attr-defined --no-namespace-packages --exclude (taipy/templates/|tools/|doc/gui/examples/.*/builder.py|taipy/common/config/config.pyi) --follow-imports skip --disable-error-code import-untyped"
  14. - uses: chartboost/ruff-action@v1
  15. tests:
  16. needs: linter
  17. timeout-minutes: 50
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. python-version: ['3.9', '3.10', '3.11', '3.12']
  22. os: [ubuntu-latest, windows-latest, macos-13]
  23. runs-on: ${{ matrix.os }}
  24. steps:
  25. - uses: actions/checkout@v4
  26. - uses: dorny/paths-filter@v2
  27. id: changes
  28. with:
  29. filters: |
  30. common:
  31. - 'taipy/common/**'
  32. core:
  33. - 'taipy/core/**'
  34. gui:
  35. - 'taipy/gui/**'
  36. - 'frontend/taipy-gui/**'
  37. gui-core:
  38. - 'taipy/gui_core/**'
  39. rest:
  40. - 'taipy/rest/**'
  41. templates:
  42. - 'taipy/templates/**'
  43. - uses: actions/setup-python@v5
  44. with:
  45. python-version: ${{matrix.python-version}}
  46. cache: 'pipenv'
  47. cache-dependency-path: 'Pipfile'
  48. - name: Install Setuptools and wheel
  49. run: pip install --upgrade setuptools wheel
  50. - name: Install pipenv
  51. run: pip install pipenv --upgrade
  52. - name: Install Dependencies
  53. run: pipenv install --dev --python=${{ matrix.python-version }}
  54. - name: Setup LibMagic (MacOS)
  55. if: matrix.os == 'macos-13'
  56. run: brew install libmagic
  57. - name: Setup Node
  58. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  59. uses: actions/setup-node@v4
  60. with:
  61. node-version: 20
  62. cache: 'npm'
  63. cache-dependency-path: '**/package-lock.json'
  64. - name: Hash frontend source code
  65. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  66. id: hash-frontend
  67. run: |
  68. pipenv run python tools/frontend/hash_source.py
  69. echo "HASH=$(cat hash.txt)" >> $GITHUB_OUTPUT
  70. rm hash.txt
  71. shell: bash
  72. - name: Restore cached frontend build
  73. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  74. id: cache-fe-build
  75. uses: actions/cache@v4
  76. with:
  77. path: |
  78. taipy/gui/webapp
  79. taipy/gui_core/lib
  80. key: frontend-build-${{ runner.os }}-${{ steps.hash-frontend.outputs.HASH }}
  81. - name: Frontend Bundle Build
  82. if: (steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true') && steps.cache-fe-build.outputs.cache-hit != 'true'
  83. run: pipenv run python tools/frontend/bundle_build.py
  84. - name: Install Playwright
  85. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  86. run: pipenv run playwright install chromium --with-deps
  87. - name: Pytest Common
  88. if: steps.changes.outputs.common == 'true'
  89. run: pipenv run pytest tests/common
  90. - name: Pytest Core
  91. if: steps.changes.outputs.core == 'true'
  92. run: pipenv run pytest -m "not orchestrator_dispatcher and not standalone" tests/core
  93. - name: Run GUI Test Action
  94. if: steps.changes.outputs.gui == 'true'
  95. uses: ./.github/actions/gui-test
  96. with:
  97. os: ${{ matrix.os }}
  98. - name: Pytest GUI Core
  99. if: steps.changes.outputs.gui-core == 'true'
  100. run: pipenv run pytest tests/gui_core
  101. - name: Pytest Rest
  102. if: steps.changes.outputs.rest == 'true'
  103. run: pipenv run pytest tests/rest
  104. - name: Pytest Templates
  105. if: steps.changes.outputs.templates == 'true'
  106. run: pipenv run pytest tests/templates
  107. submit_tests:
  108. needs: linter
  109. timeout-minutes: 40
  110. strategy:
  111. fail-fast: false
  112. matrix:
  113. python-version: ['3.9', '3.10', '3.11', '3.12']
  114. os: [ubuntu-latest, windows-latest, macos-13]
  115. runs-on: ${{ matrix.os }}
  116. steps:
  117. - uses: actions/checkout@v4
  118. - uses: dorny/paths-filter@v2
  119. id: changes
  120. with:
  121. filters: |
  122. core:
  123. - 'taipy/core/**'
  124. - name: Setup Python with cache
  125. if: steps.changes.outputs.core == 'true'
  126. uses: actions/setup-python@v5
  127. with:
  128. python-version: ${{matrix.python-version}}
  129. cache: 'pipenv'
  130. cache-dependency-path: 'Pipfile'
  131. - name: Install pipenv
  132. if: steps.changes.outputs.core == 'true'
  133. run: pip install pipenv --upgrade
  134. - name: Install Dependencies
  135. if: steps.changes.outputs.core == 'true'
  136. run: pipenv install --dev --python=${{ matrix.python-version }}
  137. - name: Setup LibMagic (MacOS)
  138. if: matrix.os == 'macos-13' && steps.changes.outputs.core == 'true'
  139. run: brew install libmagic
  140. - name: Pytest Core orchestrator_dispatcher
  141. if: steps.changes.outputs.core == 'true'
  142. run: pipenv run pytest -m "orchestrator_dispatcher" tests/core
  143. standalone_tests:
  144. needs: linter
  145. timeout-minutes: 40
  146. strategy:
  147. fail-fast: false
  148. matrix:
  149. python-version: ['3.9', '3.10', '3.11', '3.12']
  150. os: [ubuntu-latest, windows-latest, macos-13]
  151. runs-on: ${{ matrix.os }}
  152. steps:
  153. - uses: actions/checkout@v4
  154. - uses: dorny/paths-filter@v2
  155. id: changes
  156. with:
  157. filters: |
  158. core:
  159. - 'taipy/core/**'
  160. - name: Setup Python with cache
  161. if: steps.changes.outputs.core == 'true'
  162. uses: actions/setup-python@v5
  163. with:
  164. python-version: ${{matrix.python-version}}
  165. cache: 'pipenv'
  166. cache-dependency-path: 'Pipfile'
  167. - name: Install pipenv
  168. if: steps.changes.outputs.core == 'true'
  169. run: pip install pipenv --upgrade
  170. - name: Install Dependencies
  171. if: steps.changes.outputs.core == 'true'
  172. run: pipenv install --dev --python=${{ matrix.python-version }}
  173. - name: Setup LibMagic (MacOS)
  174. if: matrix.os == 'macos-13' && steps.changes.outputs.core == 'true'
  175. run: brew install libmagic
  176. - name: Pytest Core standalone
  177. if: steps.changes.outputs.core == 'true'
  178. run: pipenv run pytest -m "standalone" tests/core