integration_tests.yml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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", "3.11", "3.12", "3.13"]
  41. runs-on: ${{ matrix.os }}
  42. steps:
  43. - uses: actions/checkout@v4
  44. - uses: ./.github/actions/setup_build_env
  45. with:
  46. python-version: ${{ matrix.python-version }}
  47. run-uv-sync: true
  48. - name: Clone Reflex Examples Repo
  49. uses: actions/checkout@v4
  50. with:
  51. repository: reflex-dev/reflex-examples
  52. path: reflex-examples
  53. - name: Install requirements for counter example
  54. working-directory: ./reflex-examples/counter
  55. run: |
  56. uv pip install -r requirements.txt
  57. - name: Check export --backend-only before init for counter example
  58. working-directory: ./reflex-examples/counter
  59. run: |
  60. uv run reflex export --backend-only
  61. - name: Check run --backend-only before init for counter example
  62. run: |
  63. uv run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
  64. - name: Init Website for counter example
  65. working-directory: ./reflex-examples/counter
  66. run: |
  67. uv run reflex init --loglevel debug
  68. - name: Check export for counter example
  69. working-directory: ./reflex-examples/counter
  70. run: |
  71. uv run reflex export
  72. - name: Run Website and Check for errors
  73. run: |
  74. # Check that npm is home
  75. npm -v
  76. uv run bash scripts/integration.sh ./reflex-examples/counter dev
  77. - name: Install requirements for nba proxy example
  78. working-directory: ./reflex-examples/nba-proxy
  79. run: |
  80. uv pip install -r requirements.txt
  81. - name: Check export --backend-only before init for nba-proxy example
  82. working-directory: ./reflex-examples/nba-proxy
  83. run: |
  84. uv run reflex export --backend-only
  85. - name: Init Website for nba-proxy example
  86. working-directory: ./reflex-examples/nba-proxy
  87. run: |
  88. uv run reflex init --loglevel debug
  89. - name: Run Website and Check for errors
  90. run: |
  91. # Check that npm is home
  92. npm -v
  93. uv run bash scripts/integration.sh ./reflex-examples/nba-proxy dev
  94. reflex-web:
  95. strategy:
  96. fail-fast: false
  97. matrix:
  98. python-version: ["3.11", "3.12"]
  99. env:
  100. REFLEX_WEB_WINDOWS_OVERRIDE: "1"
  101. runs-on: ubuntu-latest
  102. steps:
  103. - uses: actions/checkout@v4
  104. - uses: ./.github/actions/setup_build_env
  105. with:
  106. python-version: ${{ matrix.python-version }}
  107. run-uv-sync: true
  108. - name: Clone Reflex Website Repo
  109. uses: actions/checkout@v4
  110. with:
  111. repository: reflex-dev/reflex-web
  112. ref: main
  113. path: reflex-web
  114. - name: Compile pyproject.toml into requirements.txt
  115. working-directory: ./reflex-web
  116. run: uv pip compile pyproject.toml --no-annotate --no-header --no-deps --output-file requirements.txt
  117. - name: Install Requirements for reflex-web
  118. working-directory: ./reflex-web
  119. run: uv pip install $(grep -ivE "reflex " requirements.txt)
  120. - name: Init Website for reflex-web
  121. working-directory: ./reflex-web
  122. run: uv run reflex init
  123. - name: Run Website and Check for errors
  124. run: |
  125. # Check that npm is home
  126. npm -v
  127. uv run bash scripts/integration.sh ./reflex-web prod
  128. rx-shout-from-template:
  129. strategy:
  130. fail-fast: false
  131. runs-on: ubuntu-latest
  132. steps:
  133. - uses: actions/checkout@v4
  134. - uses: ./.github/actions/setup_build_env
  135. with:
  136. python-version: 3.13
  137. run-uv-sync: true
  138. - name: Create app directory
  139. run: mkdir rx-shout-from-template
  140. - name: Init reflex-web from template
  141. run: uv run reflex init --template https://github.com/masenf/rx_shout
  142. working-directory: ./rx-shout-from-template
  143. - name: ignore reflex pin in requirements
  144. run: sed -i -e '/reflex==/d' requirements.txt
  145. working-directory: ./rx-shout-from-template
  146. - name: Install additional dependencies
  147. run: uv pip install -r requirements.txt
  148. working-directory: ./rx-shout-from-template
  149. - name: Run Website and Check for errors
  150. run: |
  151. # Check that npm is home
  152. npm -v
  153. uv run bash scripts/integration.sh ./rx-shout-from-template prod
  154. reflex-web-macos:
  155. if: github.event_name == 'push' && github.ref == 'refs/heads/main'
  156. strategy:
  157. fail-fast: false
  158. matrix:
  159. # Note: py311 version chosen due to available arm64 darwin builds.
  160. python-version: ["3.11", "3.12"]
  161. runs-on: macos-latest
  162. steps:
  163. - uses: actions/checkout@v4
  164. - uses: ./.github/actions/setup_build_env
  165. with:
  166. python-version: ${{ matrix.python-version }}
  167. run-uv-sync: true
  168. - name: Clone Reflex Website Repo
  169. uses: actions/checkout@v4
  170. with:
  171. repository: reflex-dev/reflex-web
  172. ref: main
  173. path: reflex-web
  174. - name: Install Requirements for reflex-web
  175. working-directory: ./reflex-web
  176. run: uv pip install -r requirements.txt
  177. - name: Init Website for reflex-web
  178. working-directory: ./reflex-web
  179. run: uv run reflex init
  180. - name: Run Website and Check for errors
  181. run: |
  182. # Check that npm is home
  183. npm -v
  184. uv run bash scripts/integration.sh ./reflex-web prod