forked from bensheldon/queue-shootout
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (73 loc) · 2.09 KB
/
shootout.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
name: Shootout
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
iterations:
description: 'Iterations'
required: true
default: 5
test_period:
description: 'Test Period'
required: false
default: 0.2
warmup_period:
description: 'Warmup Period'
required: false
default: 0.2
job_count:
description: 'Job Count'
required: false
default: 1000
synchronous_commit:
description: 'Synchronous Commit'
required: false
default: 'on'
jobs:
shootout:
name: Shootout
runs-on: ubuntu-latest
timeout-minutes: 15
env:
PGHOST: localhost
PGUSER: shootout
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
# Shootout ENV
ITERATIONS: ${{ github.event.inputs.iterations || 5 }}
TEST_PERIOD: ${{ github.event.inputs.test_period || 0.2 }}
WARMUP_PERIOD: ${{ github.event.inputs.warmup_period || 0.2 }}
JOB_COUNT: ${{ github.event.inputs.job_count || 1000 }}
SYNCHRONOUS_COMMIT: ${{ github.event.inputs.synchronous_commit || 'on' }}
services:
postgres:
image: postgres:latest
ports: ["5432:5432"]
env:
POSTGRES_USER: shootout
POSTGRES_DB: shootout
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:latest
ports: ["6379:6379"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
# - name: Bundle update to the latest
# run: bundle config unset deployment && bundle update
# Test
- name: Run shootout
run: bundle exec rake
env:
DATABASE_URL: postgres://shootout@localhost:${{ job.services.postgres.ports[5432] }}
REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}