integration_tests.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. name: integration-tests
  2. on:
  3. push:
  4. branches: ["main"]
  5. paths-ignore:
  6. - "**/*.md"
  7. pull_request:
  8. branches: ["main"]
  9. paths-ignore:
  10. - "**/*.md"
  11. concurrency:
  12. group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
  13. cancel-in-progress: true
  14. permissions:
  15. contents: read
  16. defaults:
  17. run:
  18. shell: bash
  19. env:
  20. # Windows CI would fail without this.
  21. # Ref: https://gist.github.com/NodeJSmith/e7e37f2d3f162456869f015f842bcf15
  22. # TODO: can we fix windows encoding natively within reflex? Bug above can hit real users too (less common, but possible)
  23. # - Catch encoding errors when printing logs
  24. # - Best effort print lines that contain illegal chars (map to some default char, etc.)
  25. PYTHONIOENCODING: "utf8"
  26. TELEMETRY_ENABLED: false
  27. NODE_OPTIONS: "--max_old_space_size=8192"
  28. PR_TITLE: ${{ github.event.pull_request.title }}
  29. jobs:
  30. example-counter-and-nba-proxy:
  31. env:
  32. OUTPUT_FILE: import_benchmark.json
  33. timeout-minutes: 30
  34. strategy:
  35. # Prioritize getting more information out of the workflow (even if something fails)
  36. fail-fast: false
  37. matrix:
  38. # Show OS combos first in GUI
  39. os: [ubuntu-latest, windows-latest]
  40. python-version: ["3.10.16", "3.11.11", "3.12.8", "3.13.1"]
  41. exclude:
  42. - os: windows-latest
  43. python-version: "3.11.11"
  44. - os: windows-latest
  45. python-version: "3.10.16"
  46. include:
  47. - os: windows-latest
  48. python-version: "3.11.9"
  49. - os: windows-latest
  50. python-version: "3.10.11"
  51. runs-on: ${{ matrix.os }}
  52. steps:
  53. - uses: actions/checkout@v4
  54. - uses: ./.github/actions/setup_build_env
  55. with:
  56. python-version: ${{ matrix.python-version }}
  57. run-uv-sync: true
  58. - name: Clone Reflex Examples Repo
  59. uses: actions/checkout@v4
  60. with:
  61. repository: reflex-dev/reflex-examples
  62. path: reflex-examples
  63. - name: Install requirements for counter example
  64. working-directory: ./reflex-examples/counter
  65. run: |
  66. uv pip install -r requirements.txt
  67. - name: Check export --backend-only before init for counter example
  68. working-directory: ./reflex-examples/counter
  69. run: |
  70. uv run reflex export --backend-only
  71. - name: Check run --backend-only before init for counter example
  72. run: |
  73. uv run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
  74. - name: Init Website for counter example
  75. working-directory: ./reflex-examples/counter
  76. run: |
  77. uv run reflex init --loglevel debug
  78. - name: Check export for counter example
  79. working-directory: ./reflex-examples/counter
  80. run: |
  81. uv run reflex export
  82. - name: Run Website and Check for errors
  83. run: |
  84. # Check that npm is home
  85. npm -v
  86. uv run bash scripts/integration.sh ./reflex-examples/counter dev
  87. - name: Install requirements for nba proxy example
  88. working-directory: ./reflex-examples/nba-proxy
  89. run: |
  90. uv pip install -r requirements.txt
  91. - name: Check export --backend-only before init for nba-proxy example
  92. working-directory: ./reflex-examples/nba-proxy
  93. run: |
  94. uv run reflex export --backend-only
  95. - name: Init Website for nba-proxy example
  96. working-directory: ./reflex-examples/nba-proxy
  97. run: |
  98. uv run reflex init --loglevel debug
  99. - name: Run Website and Check for errors
  100. run: |
  101. # Check that npm is home
  102. npm -v
  103. uv run bash scripts/integration.sh ./reflex-examples/nba-proxy dev
  104. reflex-web:
  105. strategy:
  106. fail-fast: false
  107. matrix:
  108. # Show OS combos first in GUI
  109. os: [ubuntu-latest]
  110. python-version: ["3.11.11", "3.12.8"]
  111. env:
  112. REFLEX_WEB_WINDOWS_OVERRIDE: "1"
  113. runs-on: ${{ matrix.os }}
  114. steps:
  115. - uses: actions/checkout@v4
  116. - uses: ./.github/actions/setup_build_env
  117. with:
  118. python-version: ${{ matrix.python-version }}
  119. run-uv-sync: true
  120. - name: Clone Reflex Website Repo
  121. uses: actions/checkout@v4
  122. with:
  123. repository: reflex-dev/reflex-web
  124. ref: main
  125. path: reflex-web
  126. - name: Install Requirements for reflex-web
  127. working-directory: ./reflex-web
  128. run: uv pip install $(grep -ivE "reflex " requirements.txt)
  129. - name: Init Website for reflex-web
  130. working-directory: ./reflex-web
  131. run: uv run reflex init
  132. - name: Run Website and Check for errors
  133. run: |
  134. # Check that npm is home
  135. npm -v
  136. uv run bash scripts/integration.sh ./reflex-web prod
  137. rx-shout-from-template:
  138. strategy:
  139. fail-fast: false
  140. runs-on: ubuntu-latest
  141. steps:
  142. - uses: actions/checkout@v4
  143. - uses: ./.github/actions/setup_build_env
  144. with:
  145. python-version: "3.11.11"
  146. run-uv-sync: true
  147. - name: Create app directory
  148. run: mkdir rx-shout-from-template
  149. - name: Init reflex-web from template
  150. run: uv run reflex init --template https://github.com/masenf/rx_shout
  151. working-directory: ./rx-shout-from-template
  152. - name: ignore reflex pin in requirements
  153. run: sed -i -e '/reflex==/d' requirements.txt
  154. working-directory: ./rx-shout-from-template
  155. - name: Install additional dependencies
  156. run: uv pip install -r requirements.txt
  157. working-directory: ./rx-shout-from-template
  158. - name: Run Website and Check for errors
  159. run: |
  160. # Check that npm is home
  161. npm -v
  162. uv run bash scripts/integration.sh ./rx-shout-from-template prod
  163. reflex-web-macos:
  164. if: github.event_name == 'push' && github.ref == 'refs/heads/main'
  165. strategy:
  166. fail-fast: false
  167. matrix:
  168. # Note: py311 version chosen due to available arm64 darwin builds.
  169. python-version: ["3.11.9", "3.12.8"]
  170. runs-on: macos-latest
  171. steps:
  172. - uses: actions/checkout@v4
  173. - uses: ./.github/actions/setup_build_env
  174. with:
  175. python-version: ${{ matrix.python-version }}
  176. run-uv-sync: true
  177. - name: Clone Reflex Website Repo
  178. uses: actions/checkout@v4
  179. with:
  180. repository: reflex-dev/reflex-web
  181. ref: main
  182. path: reflex-web
  183. - name: Install Requirements for reflex-web
  184. working-directory: ./reflex-web
  185. run: uv pip install -r requirements.txt
  186. - name: Init Website for reflex-web
  187. working-directory: ./reflex-web
  188. run: uv run reflex init
  189. - name: Run Website and Check for errors
  190. run: |
  191. # Check that npm is home
  192. npm -v
  193. uv run bash scripts/integration.sh ./reflex-web prod