-
Notifications
You must be signed in to change notification settings - Fork 1.7k
227 lines (208 loc) ยท 7.33 KB
/
integration_tests.yml
File metadata and controls
227 lines (208 loc) ยท 7.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: integration-tests
on:
push:
branches: ["main"]
paths-ignore:
- "**/*.md"
pull_request:
branches: ["main"]
paths-ignore:
- "**/*.md"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash
env:
# Windows CI would fail without this.
# Ref: https://gist.github.com/NodeJSmith/e7e37f2d3f162456869f015f842bcf15
# TODO: can we fix windows encoding natively within reflex? Bug above can hit real users too (less common, but possible)
# - Catch encoding errors when printing logs
# - Best effort print lines that contain illegal chars (map to some default char, etc.)
PYTHONIOENCODING: "utf8"
REFLEX_TELEMETRY_ENABLED: false
NODE_OPTIONS: "--max_old_space_size=8192"
PR_TITLE: ${{ github.event.pull_request.title }}
jobs:
example-counter-and-nba-proxy:
env:
OUTPUT_FILE: import_benchmark.json
timeout-minutes: 30
strategy:
# Prioritize getting more information out of the workflow (even if something fails)
fail-fast: false
matrix:
# Show OS combos first in GUI
os: [ubuntu-latest, windows-latest]
python-version: ["3.14"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-uv-sync: true
- name: Clone Reflex Examples Repo
uses: actions/checkout@v4
with:
repository: reflex-dev/reflex-examples
path: reflex-examples
- name: Install requirements for counter example
working-directory: ./reflex-examples/counter
run: |
uv pip install -r requirements.txt
- name: Check export --backend-only before init for counter example
working-directory: ./reflex-examples/counter
run: |
uv run reflex export --backend-only
- name: Check run --backend-only before init for counter example
run: |
uv run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
- name: Init Website for counter example
working-directory: ./reflex-examples/counter
run: |
uv run reflex init --loglevel debug
- name: Check export for counter example
working-directory: ./reflex-examples/counter
run: |
uv run reflex export
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run bash scripts/integration.sh ./reflex-examples/counter dev
- name: Install requirements for nba proxy example
working-directory: ./reflex-examples/nba-proxy
run: |
uv pip install -r requirements.txt
- name: Check export --backend-only before init for nba-proxy example
working-directory: ./reflex-examples/nba-proxy
run: |
uv run reflex export --backend-only
- name: Init Website for nba-proxy example
working-directory: ./reflex-examples/nba-proxy
run: |
uv run reflex init --loglevel debug
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run bash scripts/integration.sh ./reflex-examples/nba-proxy dev
reflex-docs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
env:
REFLEX_WEB_WINDOWS_OVERRIDE: "1"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
# Install sfw BEFORE any dependency installation so all packages are scanned.
- name: Install Socket.dev Firewall (free)
uses: SocketDev/action@2d3f25590c6ed6ba11a9a14c064d962a3a04698f # v1.3.1
with:
mode: firewall-free
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: Activate sfw shims for npm and bun
run: |
SHIM_DIR="$(cd scripts/sfw-shims && pwd)"
echo "$SHIM_DIR" >> "$GITHUB_PATH"
echo "REFLEX_USE_SYSTEM_BUN=1" >> "$GITHUB_ENV"
# Inline setup_build_env steps so all installs go through sfw.
- name: Install UV
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: false
activate-environment: true
cache-dependency-glob: "uv.lock"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install reflex-docs dependencies
working-directory: ./docs/app
run: sfw uv sync
- name: Init Website for reflex-docs
working-directory: ./docs/app
run: uv run --active --no-sync reflex init
- name: Run Website and Check for errors
run: |
# Verify sfw wrappers are on PATH
which npm && npm -v
uv run --active --no-sync bash scripts/integration.sh ./docs/app prod
- name: Upload Socket.dev Firewall report
if: always()
uses: actions/upload-artifact@v4
with:
name: sfw-report-reflex-docs-py${{ matrix.python-version }}
path: ${{ env.SFW_JSON_REPORT_PATH }}
if-no-files-found: warn
rx-shout-from-template:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- uses: ./.github/actions/setup_build_env
with:
python-version: 3.14
run-uv-sync: true
- name: Create app directory
run: mkdir rx-shout-from-template
- name: Init reflex-web from template
run: uv run reflex init --template https://github.com/masenf/rx_shout
working-directory: ./rx-shout-from-template
- name: ignore reflex pin in requirements
run: sed -i -e '/reflex==/d' requirements.txt
working-directory: ./rx-shout-from-template
- name: Install additional dependencies
run: uv pip install -r requirements.txt
working-directory: ./rx-shout-from-template
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run bash scripts/integration.sh ./rx-shout-from-template prod
reflex-docs-macos:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
# Note: py311 version chosen due to available arm64 darwin builds.
python-version: ["3.11", "3.12"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
- name: Install Requirements for reflex-docs
working-directory: ./docs/app
run: uv sync
- name: Init Website for reflex-docs
working-directory: ./docs/app
run: uv run --active --no-sync reflex init
- name: Run Website and Check for errors
run: |
# Check that npm is home
npm -v
uv run --active --no-sync bash scripts/integration.sh ./docs/app prod