Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
guille-sage committed Dec 19, 2023
1 parent d3b80f7 commit 75a178a
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 26 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,44 @@ jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
ruby: ['2.7', '3.0', '3.2']

services:
eventq_redis:
image: redis:alpine
ports:
- 6379:6379
rabbitmq:
image: rabbitmq:3.6.5
localstack:
# changes to multi region support after this version break tests
image: localstack/localstack:0.12.16
env:
SERVICES: sqs,sns
HOSTNAME: localstack
HOSTNAME_EXTERNAL: localstack
ports:
- "8085:8080"
- "4566:4566"

steps:
- uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Bundle
run: bundle install
- name: Run tests
run: |
cd script
docker-compose up -d
docker exec testrunner bash -c "cd src && bundle install && bundle exec rspec && exit"
run: "bundle exec rspec"
env:
AWS_ACCESS_KEY_ID: mock_id
AWS_SECRET_ACCESS_KEY: mock_password
AWS_REGION: eu-west-1
AWS_SQS_ENDPOINT: http://localstack:4566
AWS_SNS_ENDPOINT: http://localstack:4566

- name: Code Coverage
uses: paambaati/codeclimate-action@v2.7.5
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ruby:3.2-alpine3.18

RUN apk add --update ca-certificates bash && update-ca-certificates && rm -rf /var/cache/apk/*
RUN apk update && apk add --no-cache build-base

RUN set -ex \
&& apk add --no-cache --virtual .gem-builddeps \
ruby-dev build-base libressl-dev

COPY Gemfile .
COPY eventq.gemspec .
COPY EVENTQ_VERSION .

RUN bundle install --no-cache \
&& apk del .gem-builddeps
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Specify your gem's dependencies in eventq.gemspec
gemspec


gem 'json', '~> 2'
gem 'redlock', '~> 1'

platforms :ruby do
gem 'oj', '3.6.10'
gem 'openssl', '2.1.2'
gem 'bunny'
gem 'oj'
gem 'openssl'
end
4 changes: 2 additions & 2 deletions script/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ services:
- rabbitmq
- localstack
volumes:
- ./container_loop.sh:/scripts/container_loop.sh
- ../:/src
- ./script/container_loop.sh:/scripts/container_loop.sh
- ./:/src
environment:
- AWS_ACCESS_KEY_ID=mock_id
- AWS_SECRET_ACCESS_KEY=mock_password
Expand Down
5 changes: 2 additions & 3 deletions lib/eventq.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'securerandom'
require 'redlock'
require 'class_kit'
Expand All @@ -22,6 +24,3 @@
require_relative 'eventq/eventq_base/signature_providers'
require_relative 'eventq/eventq_base/exceptions'
require_relative 'eventq/queue_worker'



13 changes: 0 additions & 13 deletions script/Dockerfile

This file was deleted.

0 comments on commit 75a178a

Please sign in to comment.