Skip to content

chore: Benchmark db lookups #4

chore: Benchmark db lookups

chore: Benchmark db lookups #4

Workflow file for this run

name: Benchmark
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
benchmark:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.0
bundler-cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Set up database
run: |
createdb -h localhost -U postgres cool_id_benchmark
env:
PGPASSWORD: postgres
- name: Run benchmark
run: |
bundle exec ruby benchmark/cool_id_benchmark.rb 1000000
env:
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres