-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.5 KB
/
performance-ci.yml
File metadata and controls
53 lines (44 loc) · 1.5 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
name: Performance Testing
on:
schedule:
- cron: '0 0 * * 1' # 毎週月曜日 0時
workflow_dispatch: # マニュアル実行も可能
jobs:
performance:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
cd backend
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-benchmark pytest-asyncio
- name: Run performance tests
run: |
cd backend
export TESTING=True
export DATABASE_URL=sqlite+aiosqlite:///:memory:
python -m pytest tests/performance/ -v --benchmark-autosave --benchmark-json=benchmark.json
- name: Upload benchmark results
uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: backend/benchmark.json
- name: Compare performance
if: github.event_name == 'schedule'
run: |
cd backend
python -m pytest tests/performance/ -v --benchmark-compare --benchmark-json=benchmark.json
- name: Generate performance report
if: github.event_name == 'schedule'
run: |
cd backend
python -m pytest tests/performance/ -v --benchmark-json=benchmark.json --benchmark-compare --benchmark-compare-fail=min:1.10,max:0.90