Repository navigation
240 lines (234 loc) · 9.1 KB
/
Copy pathci-integration.yml
File metadata and controls
240 lines (234 loc) · 9.1 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
228
229
230
231
232
233
234
235
236
237
238
239
240
name: CI / Integration
on:
workflow_call:
inputs:
database:
type: boolean
default: false
release:
type: boolean
default: false
network_frameworks:
type: string
default: '[]'
full:
type: boolean
default: false
permissions:
contents: read
jobs:
database-timezone:
name: MySQL and PostgreSQL time contracts
if: inputs.database
runs-on: ubuntu-latest
timeout-minutes: 20
env:
TZ: America/New_York
PYTHONUTF8: '1'
defaults:
run:
working-directory: ruoyi-fastapi-backend
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: timezone_test
TZ: Asia/Shanghai
ports: ['3306:3306']
options: >-
--health-cmd="mysqladmin ping -h localhost -ptimezone_test"
--health-interval=10s --health-timeout=5s --health-retries=12
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: timezone_test
TZ: America/New_York
PGTZ: America/New_York
ports: ['5432:5432']
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s --health-timeout=5s --health-retries=12
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: pip
cache-dependency-path: ruoyi-fastapi-backend/requirements*.txt
- run: python -m pip install -r requirements.txt -r requirements-pg.txt -r requirements-test.txt
- name: Configure isolated database verification
run: |
mkdir -p target/ci/timezone
python - <<'PY'
import json
from pathlib import Path
for dialect, port, username, database in [('mysql', 3306, 'root', 'mysql'), ('postgresql', 5432, 'postgres', 'postgres')]:
source = dict(db_type=dialect, db_host='127.0.0.1', db_port=port, db_username=username,
db_password='timezone_test', db_database=database)
Path(f'target/ci/timezone/{dialect}.json').write_text(json.dumps(source))
PY
- name: Verify drivers, CRUD and scheduler persistence
run: |
python -m scripts.verify_timezone_database --config target/ci/timezone/mysql.json --report target/ci/timezone/mysql-report.json
python -m scripts.verify_timezone_database --config target/ci/timezone/postgresql.json --report target/ci/timezone/postgresql-report.json
- uses: actions/upload-artifact@v6
if: always()
with:
name: integration-database-timezones
path: ruoyi-fastapi-backend/target/ci/timezone/*-report.json
retention-days: 7
task-bundle:
name: Task plugin bundle
if: inputs.release
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: ruoyi-fastapi-backend/plugins/examples/python/task_demo/web
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
cache-dependency-path: ruoyi-fastapi-backend/plugins/examples/python/task_demo/web/package.json
- run: npm install --no-audit --no-fund --package-lock=false
- run: npm test
- run: npm run build
- uses: actions/upload-artifact@v6
with:
name: integration-task-bundle
path: ruoyi-fastapi-backend/plugins/examples/python/task_demo/web/dist/
if-no-files-found: error
retention-days: 1
release:
name: Plugin maintenance / Python ${{ matrix.python }}
needs: task-bundle
if: inputs.release
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python: ${{ fromJSON(inputs.full && '["3.10","3.11","3.12","3.13"]' || '["3.12"]') }}
defaults:
run:
working-directory: ruoyi-fastapi-backend
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ci-only-mysql
ports: ['3306:3306']
options: >-
--health-cmd="mysqladmin ping -h localhost -pci-only-mysql"
--health-interval=10s --health-timeout=5s --health-retries=12
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: ci-only-postgres
ports: ['5432:5432']
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s --health-timeout=5s --health-retries=12
redis:
image: redis:6.2
ports: ['6379:6379']
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s --health-timeout=5s --health-retries=12
env:
RUOYI_PLUGIN_IT_ALLOW: '1'
RUOYI_IT_MYSQL_PASSWORD: ci-only-mysql
RUOYI_IT_PG_PASSWORD: ci-only-postgres
RUOYI_IT_REDIS_PASSWORD: ''
PYTHONUTF8: '1'
_TYPER_FORCE_DISABLE_TERMINAL: '1'
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v6
with:
name: integration-task-bundle
path: ruoyi-fastapi-backend/plugins/examples/python/task_demo/web/dist
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: ruoyi-fastapi-backend/requirements*.txt
- run: python -m pip install -r requirements.txt -r requirements-pg.txt
- name: Verify MySQL and PostgreSQL maintenance releases
shell: bash
run: |
mkdir -p target/ci/release
python scripts/plugin_release_integration.py --engine mysql 2>&1 | tee target/ci/release/mysql.log
python scripts/plugin_release_integration.py --engine postgresql 2>&1 | tee target/ci/release/postgresql.log
- uses: actions/upload-artifact@v6
if: always()
with:
name: integration-release-${{ matrix.python }}
path: ruoyi-fastapi-backend/target/ci/release/
retention-days: 7
network:
name: ${{ matrix.framework }} proxy and plugin sessions
if: inputs.network_frameworks != '[]'
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
framework: ${{ fromJSON(inputs.network_frameworks) }}
defaults:
run:
working-directory: ruoyi-fastapi-backend
env:
RUOYI_PLUGIN_NETWORK_SMOKE: '1'
RUOYI_PLUGIN_FRONTEND_FRAMEWORK: ${{ matrix.framework }}
NODE_OPTIONS: ${{ matrix.framework == 'vue2' && '--openssl-legacy-provider' || '' }}
DB_SOURCES: '{"primary":{"db_type":"mysql","db_host":"127.0.0.1","db_port":3306,"db_username":"network-smoke","db_password":"network-smoke","db_database":"network-smoke"}}'
JWT_SECRET_KEY: isolated-plugin-network-smoke-ci-only
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: pip
cache-dependency-path: ruoyi-fastapi-backend/requirements*.txt
- uses: actions/setup-node@v6
with:
node-version: '22'
cache: npm
cache-dependency-path: ruoyi-fastapi-frontend/${{ matrix.framework }}/web/package.json
- uses: pnpm/action-setup@v5
if: matrix.framework == 'react'
with:
package_json_file: ruoyi-fastapi-frontend/react/web/package.json
- name: Locate the React package cache
if: matrix.framework == 'react'
id: react-cache
working-directory: ruoyi-fastapi-frontend/react/web
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- name: Cache React dependencies
if: matrix.framework == 'react'
uses: actions/cache@v5
with:
path: ${{ steps.react-cache.outputs.path }}
key: ${{ runner.os }}-network-react-${{ hashFiles('ruoyi-fastapi-frontend/react/web/package.json', 'ruoyi-fastapi-frontend/react/web/pnpm-workspace.yaml') }}
restore-keys: ${{ runner.os }}-network-react-
- run: python -m pip install -r requirements.txt -r requirements-test.txt playwright==1.62.0
- run: python -m playwright install --with-deps chromium
- name: Install Vue Web dependencies
if: matrix.framework != 'react'
run: npm --prefix ../ruoyi-fastapi-frontend/${{ matrix.framework }}/web install --no-audit --no-fund --package-lock=false
- name: Install React Web dependencies
if: matrix.framework == 'react'
working-directory: ruoyi-fastapi-frontend/react/web
run: pnpm install --no-frozen-lockfile
- name: Verify HTTPS proxy, iframe sessions and long connections
run: python -m pytest tests/plugins/integration/test_network_smoke.py -m browser --strict-markers -v --junitxml=target/plugin-network-smoke/${{ matrix.framework }}/results.xml
- run: python ../.github/scripts/check_test_report.py target/plugin-network-smoke/${{ matrix.framework }}/results.xml
- uses: actions/upload-artifact@v6
if: always()
with:
name: integration-network-${{ matrix.framework }}
path: ruoyi-fastapi-backend/target/plugin-network-smoke/${{ matrix.framework }}/
retention-days: 7