Skip to content

Commit

Permalink
Use GH actions for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pawurb committed Aug 19, 2023
1 parent c4d83cc commit dd9df17
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 31 deletions.
30 changes: 0 additions & 30 deletions .circleci/config.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Ruby CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.6']
steps:
- uses: actions/checkout@v3
- name: Run PostgreSQL
run: |
docker run --env POSTGRES_USER=postgres \
--env POSTGRES_DB=activerecord-analyze-test \
--env POSTGRES_PASSWORD=secret \
-d -p 5432:5432 postgres:12.10-alpine \
postgres -c shared_preload_libraries=pg_stat_statements
sleep 10
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Setup dependencies
run: |
gem update --system
gem install bundler
sudo apt-get update --allow-releaseinfo-change
sudo apt install postgresql-client
sudo apt install libpq-dev
bundle config set --local path 'vendor/bundle'
bundle install
sleep 10
- name: Run tests
env:
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_DB: activerecord-analyze-test
POSTGRES_PASSWORD: secret
DATABASE_URL: postgresql://postgres:secret@localhost:5432/activerecord-analyze-test
run: |
bundle exec rspec spec/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ActiveRecord Analyze [![Gem Version](https://badge.fury.io/rb/activerecord-analyze.svg)](https://badge.fury.io/rb/activerecord-analyze) [![CircleCI](https://circleci.com/gh/pawurb/activerecord-analyze.svg?style=svg)](https://circleci.com/gh/pawurb/activerecord-analyze)
# ActiveRecord Analyze [![Gem Version](https://badge.fury.io/rb/activerecord-analyze.svg)](https://badge.fury.io/rb/activerecord-analyze) [![GH Actions](https://github.com/pawurb/activerecord-analyze/actions/workflows/ci.yml/badge.svg)](https://github.com/pawurb/activerecord-analyze/actions)

This gem adds an `analyze` method to Active Record query objects. It executes `EXPLAIN ANALYZE` on a query SQL.

Expand Down

0 comments on commit dd9df17

Please sign in to comment.