Skip to content

Commit

Permalink
add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ankithads committed Jun 14, 2024
1 parent fcaaed1 commit 5d5f6e0
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 68 deletions.
67 changes: 0 additions & 67 deletions .circleci/config.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: tests

on:
push:

jobs:
rspec:
strategy:
fail-fast: false
matrix:
ruby_version: ["2.6", "2.7", "3.0"]
postgres-version: ["12", "13", "14", "15", "16"]

runs-on: ubuntu-latest
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_DB: que-test
POSTGRES_USER: ubuntu
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
lock_database:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_DB: lock-test
POSTGRES_USER: ubuntu
POSTGRES_PASSWORD: password
ports:
- 5434:5434
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
PGDATABASE: que-test
PGUSER: ubuntu
PGPASSWORD: password
PGHOST: localhost
LOCK_PGDATABASE: lock-test
LOCK_PGUSER: ubuntu
LOCK_PGPASSWORD: password
LOCK_PGHOST: localhost
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: "${{ matrix.ruby-version }}"
- name: Run specs
run: |
bundle exec rspec
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ group :test do
end

gem 'prometheus-client', '~> 1.0'
gem 'prometheus_gcstat', git: '[email protected]:gocardless/prometheus_gcstat_ruby'
# gem 'prometheus_gcstat', git: '[email protected]:gocardless/prometheus_gcstat_ruby'

gemspec
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def self.establish_lock_database_connection
user: ENV.fetch("LOCK_PGUSER", "postgres"),
password: ENV.fetch("LOCK_PGPASSWORD", ""),
database: ENV.fetch("LOCK_PGDATABASE", "lock-test"),
port: ENV.fetch("LOCK_PGPORT", 5434),
)
end
def self.connection
Expand Down

0 comments on commit 5d5f6e0

Please sign in to comment.