partial-tests.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 --no-namespace-packages --exclude (taipy/templates/|tools/|doc/gui/examples/.*/builder.py) --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.8', '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. cli:
  31. - 'taipy/_cli/**'
  32. config:
  33. - 'taipy/config/**'
  34. core:
  35. - 'taipy/core/**'
  36. gui:
  37. - 'taipy/gui/**'
  38. - 'frontend/taipy-gui/**'
  39. gui-core:
  40. - 'taipy/gui_core/**'
  41. logger:
  42. - 'taipy/logger/**'
  43. rest:
  44. - 'taipy/rest/**'
  45. templates:
  46. - 'taipy/templates/**'
  47. - uses: actions/setup-python@v5
  48. with:
  49. python-version: ${{matrix.python-version}}
  50. cache: 'pipenv'
  51. cache-dependency-path: 'Pipfile'
  52. - name: Install Setuptools and wheel
  53. run: pip install --upgrade setuptools wheel
  54. - name: Install pipenv
  55. run: pip install --upgrade pipenv
  56. - name: Install Dependencies
  57. run: pipenv install --dev --python=${{ matrix.python-version }}
  58. - name: Setup LibMagic (MacOS)
  59. if: matrix.os == 'macos-13'
  60. run: brew install libmagic
  61. - name: Setup Node
  62. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  63. uses: actions/setup-node@v4
  64. with:
  65. node-version: 20
  66. cache: 'npm'
  67. cache-dependency-path: '**/package-lock.json'
  68. - name: Hash frontend source code
  69. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  70. id: hash-frontend
  71. run: |
  72. pipenv run python tools/frontend/hash_source.py
  73. echo "HASH=$(cat hash.txt)" >> $GITHUB_OUTPUT
  74. rm hash.txt
  75. shell: bash
  76. - name: Restore cached frontend build
  77. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  78. id: cache-fe-build
  79. uses: actions/cache@v4
  80. with:
  81. path: |
  82. taipy/gui/webapp
  83. taipy/gui_core/lib
  84. key: frontend-build-${{ runner.os }}-${{ steps.hash-frontend.outputs.HASH }}
  85. - name: Frontend Bundle Build
  86. if: (steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true') && steps.cache-fe-build.outputs.cache-hit != 'true'
  87. run: pipenv run python tools/frontend/bundle_build.py
  88. - name: Install Playwright
  89. if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
  90. run: pipenv run playwright install chromium --with-deps
  91. - name: Pytest CLI
  92. if: steps.changes.outputs.cli == 'true'
  93. run: pipenv run pytest tests/cli
  94. - name: Pytest Config
  95. if: steps.changes.outputs.config == 'true'
  96. run: pipenv run pytest tests/config
  97. - name: Pytest Core
  98. if: steps.changes.outputs.core == 'true'
  99. run: pipenv run pytest -m "not orchestrator_dispatcher and not standalone" tests/core
  100. - name: Run GUI Test Action
  101. if: steps.changes.outputs.gui == 'true'
  102. uses: ./.github/actions/gui-test
  103. with:
  104. os: ${{ matrix.os }}
  105. - name: Pytest GUI Core
  106. if: steps.changes.outputs.gui-core == 'true'
  107. run: pipenv run pytest tests/gui_core
  108. - name: Pytest Logger
  109. if: steps.changes.outputs.logger == 'true'
  110. run: pipenv run pytest tests/logger
  111. - name: Pytest Rest
  112. if: steps.changes.outputs.rest == 'true'
  113. run: pipenv run pytest tests/rest
  114. - name: Pytest Templates
  115. if: steps.changes.outputs.templates == 'true'
  116. run: pipenv run pytest tests/templates
  117. submit_tests:
  118. needs: linter
  119. timeout-minutes: 40
  120. strategy:
  121. fail-fast: false
  122. matrix:
  123. python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
  124. os: [ubuntu-latest, windows-latest, macos-13]
  125. runs-on: ${{ matrix.os }}
  126. steps:
  127. - uses: actions/checkout@v4
  128. - uses: dorny/paths-filter@v2
  129. id: changes
  130. with:
  131. filters: |
  132. core:
  133. - 'taipy/core/**'
  134. - name: Setup Python with cache
  135. if: steps.changes.outputs.core == 'true'
  136. uses: actions/setup-python@v5
  137. with:
  138. python-version: ${{matrix.python-version}}
  139. cache: 'pipenv'
  140. cache-dependency-path: 'Pipfile'
  141. - name: Install pipenv
  142. if: steps.changes.outputs.core == 'true'
  143. run: pip install --upgrade pipenv
  144. - name: Install Dependencies
  145. if: steps.changes.outputs.core == 'true'
  146. run: pipenv install --dev --python=${{ matrix.python-version }}
  147. - name: Setup LibMagic (MacOS)
  148. if: matrix.os == 'macos-13' && steps.changes.outputs.core == 'true'
  149. run: brew install libmagic
  150. - name: Pytest Core orchestrator_dispatcher
  151. if: steps.changes.outputs.core == 'true'
  152. run: pipenv run pytest -m "orchestrator_dispatcher" tests/core
  153. standalone_tests:
  154. needs: linter
  155. timeout-minutes: 40
  156. strategy:
  157. fail-fast: false
  158. matrix:
  159. python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
  160. os: [ubuntu-latest, windows-latest, macos-13]
  161. runs-on: ${{ matrix.os }}
  162. steps:
  163. - uses: actions/checkout@v4
  164. - uses: dorny/paths-filter@v2
  165. id: changes
  166. with:
  167. filters: |
  168. core:
  169. - 'taipy/core/**'
  170. - name: Setup Python with cache
  171. if: steps.changes.outputs.core == 'true'
  172. uses: actions/setup-python@v5
  173. with:
  174. python-version: ${{matrix.python-version}}
  175. cache: 'pipenv'
  176. cache-dependency-path: 'Pipfile'
  177. - name: Install pipenv
  178. if: steps.changes.outputs.core == 'true'
  179. run: pip install --upgrade pipenv
  180. - name: Install Dependencies
  181. if: steps.changes.outputs.core == 'true'
  182. run: pipenv install --dev --python=${{ matrix.python-version }}
  183. - name: Setup LibMagic (MacOS)
  184. if: matrix.os == 'macos-13' && steps.changes.outputs.core == 'true'
  185. run: brew install libmagic
  186. - name: Pytest Core standalone
  187. if: steps.changes.outputs.core == 'true'
  188. run: pipenv run pytest -m "standalone" tests/core