forked from flipt-io/flipt
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 1.88 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
name: Benchmark
on:
push:
branches:
- lol
paths-ignore:
- "deploy/**"
- "examples/**"
- "logos/**"
- "**.md"
- "**.txt"
- "**.ya?ml"
pull_request:
paths-ignore:
- "deploy/**"
- "examples/**"
- "logos/**"
- "**.md"
- "**.txt"
- "**.ya?ml"
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
services:
postgres:
image: postgres@sha256:c132d7802dcc127486a403fb9e9a52d9df2e3ab84037c5de8395ed6ba2743e20
ports:
# will assign a random free host port
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_DB: flipt_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
mysql:
image: mysql@sha256:a31a277d8d39450220c722c1302a345c84206e7fd4cdb619e7face046e89031d
ports:
# will assign a random free host port
- 3306/tcp
env:
MYSQL_DATABASE: flipt_test
MYSQL_USER: mysql
MYSQL_PASSWORD: password
MYSQL_ALLOW_EMPTY_PASSWORD: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.17"
check-latest: true
cache: true
- uses: actions/checkout@v3
- name: Benchmark (SQLite)
run: go test -bench=. ./... -run=XXX -v
- name: Benchmark (Postgres)
run: DB_URL="postgres://postgres:password@localhost:${{ job.services.postgres.ports['5432'] }}/flipt_test?sslmode=disable" go test -bench=. ./... -run=XXX -v
- name: Benchmark (MySQL)
run: DB_URL="mysql://mysql:password@localhost:${{ job.services.mysql.ports['3306'] }}/flipt_test" go test -bench=. ./... -run=XXX -v