Repository navigation
195 lines (170 loc) · 5.4 KB
/
Copy pathqa.yml
File metadata and controls
195 lines (170 loc) · 5.4 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
name: QA
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "0 11 * * 1"
workflow_dispatch:
permissions:
contents: read
jobs:
api:
name: API (Go Echo)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout API
uses: actions/checkout@v7
with:
repository: SmartPotTech/SmartPot-API
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: '1.26.x'
cache: true
- name: Run tests
run: |
go vet ./...
go test -v ./...
web:
name: Web (SolidJS)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Web
uses: actions/checkout@v7
with:
repository: SmartPotTech/SmartPot-Web
persist-credentials: false
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint, type check, test and build
run: |
bun run lint
bun run typecheck
bun run test
bun run build
rust:
name: ${{ matrix.repository }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
repository: [ SmartPot-AI, SmartPot-DataGenerator ]
steps:
- name: Checkout ${{ matrix.repository }}
uses: actions/checkout@v7
with:
repository: SmartPotTech/${{ matrix.repository }}
persist-credentials: false
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Test and check
run: |
cargo test --all-targets
cargo clippy -- -D warnings
python:
name: ${{ matrix.repository }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
repository: [ SmartPot-Trainer, SmartPot-MCP ]
steps:
- name: Checkout ${{ matrix.repository }}
uses: actions/checkout@v7
with:
repository: SmartPotTech/${{ matrix.repository }}
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Lint and test
run: |
uv sync --frozen
uv run --frozen ruff check .
uv run --frozen pytest
containers:
name: ${{ matrix.repository }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- repository: SmartPot-Broker
test: sh tests/smoke.sh smartpot-qa:ci
- repository: SmartPot-DB
test: sh tests/validate.sh smartpot-qa:ci true
- repository: SmartPot-Cache
test: sh tests/smoke.sh smartpot-qa:ci
- repository: SmartPot-Mail
test: sh tests/smoke.sh smartpot-qa:ci
steps:
- name: Checkout ${{ matrix.repository }}
uses: actions/checkout@v7
with:
repository: SmartPotTech/${{ matrix.repository }}
persist-credentials: false
- name: Build image
run: docker build -t smartpot-qa:ci .
- name: Run smoke tests
run: ${{ matrix.test }}
e2e:
name: End-to-End
needs: [ api, web, rust, python, containers ]
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: Checkout QA configuration
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Checkout services
run: |
for repo in DB Cache Mail Broker AI API Web DataGenerator Trainer MCP; do
git clone --depth 1 "https://github.com/SmartPotTech/SmartPot-$repo.git" "services/SmartPot-$repo"
done
- name: Build images
run: |
for repo in DB Cache Mail Broker AI API Web DataGenerator Trainer MCP; do
name="$(echo "$repo" | tr '[:upper:]' '[:lower:]')"
docker build -q -t "ghcr.io/smartpottech/smartpot-$name:latest" "services/SmartPot-$repo"
done
- name: Start demo stack
env:
# Bot de prueba sin salida a Telegram: la API valida el canal y el webhook sin llamar al servicio real.
TELEGRAM_BOT_TOKEN: demo-telegram-token
TELEGRAM_BOT_USERNAME: smartpot_demo_bot
TELEGRAM_MODE: webhook
TELEGRAM_WEBHOOK_SECRET: demo-telegram-webhook-secret
TELEGRAM_API_BASE_URL: http://127.0.0.1:9
# La suite encadena registro, login y recuperación desde la misma IP.
AUTH_RATE_LIMIT_PER_MINUTE: "100"
run: docker compose -f docker/demo/compose.yaml up -d --pull never --wait --wait-timeout 300
- name: Run end-to-end checks
env:
SMARTPOT_API_URL: http://localhost:8091
SMARTPOT_MCP_URL: http://localhost:8002
SMARTPOT_MAILPIT_URL: http://localhost:8025
SMARTPOT_MAILPIT_USERNAME: admin
SMARTPOT_MAILPIT_PASSWORD: demo-mailpit-ui
SMARTPOT_DEMO_EMAIL: [email protected]
SMARTPOT_DEMO_PASSWORD: SmartPot2026
run: python3 scripts/e2e.py
- name: Show logs on failure
if: failure()
run: docker compose -f docker/demo/compose.yaml logs --tail 200
- name: Stop demo stack
if: always()
run: docker compose -f docker/demo/compose.yaml down -v