-
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (63 loc) · 1.75 KB
/
benchmark.yml
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
name: Benchmark
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
size:
description: 'number of features to load'
required: true
default: 100
type: number
push:
branches:
- main
pull_request:
branches:
- main
jobs:
benchmark:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- uses: actions/checkout@v4
- name: Create env
run: cp .env.example .env
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install deps
run: |
sudo apt-get install -y jq
pip install plotly kaleido
# hyperfine for timing
HF_VERSION=1.18.0
wget https://github.com/sharkdp/hyperfine/releases/download/v${HF_VERSION}/hyperfine_${HF_VERSION}_amd64.deb
sudo dpkg -i hyperfine_${HF_VERSION}_amd64.deb
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download fixtures
run: scripts/download-fixtures.sh
- name: Start Django
run: |
docker compose up --build -d
docker compose exec django python manage.py migrate
- name: Load .env file
uses: xom9ikk/dotenv@v2
- name: Run Benchmark
run: ./tests/benchmark/time.sh ${{ inputs.size }}
- name: Create plots
run: ./tests/benchmark/plot.py
- uses: actions/upload-artifact@v4
with:
path: |
tests/benchmark/output/benchmark.dat
tests/benchmark/output/*.png
if-no-files-found: error
- name: Failure logs
if: failure()
run: docker-compose logs