Skip to content

Move CI to GHA; update supported Ruby, ddtrace, Redis versions [DEM-331] #25

Move CI to GHA; update supported Ruby, ddtrace, Redis versions [DEM-331]

Move CI to GHA; update supported Ruby, ddtrace, Redis versions [DEM-331] #25

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
env:
app: sidekiq_publisher
jobs:
lint:
name: Lint (Ruby ${{ matrix.ruby }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [ '2.6', '2.7', '3.0', '3.1', '3.2' ]
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
- name: Run Rubocop
run: bundle exec rubocop
test:
name: Test (${{ matrix.gemfile }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
gemfile: [rails_5.1_sidekiq_5.0,
rails_5.1_sidekiq_5.1,
rails_5.1_sidekiq_5.2,
rails_5.1_sidekiq_6.0,
rails_5.1_sidekiq_6.1,
rails_5.1_sidekiq_6.2,
rails_5.1_sidekiq_6.3,
rails_5.2_sidekiq_5.0,
rails_5.2_sidekiq_5.1,
rails_5.2_sidekiq_5.2,
rails_5.2_sidekiq_6.0,
rails_5.2_sidekiq_6.1,
rails_5.2_sidekiq_6.2,
rails_5.2_sidekiq_6.3,
rails_6.0_sidekiq_5.2,
rails_6.0_sidekiq_6.0,
rails_6.0_sidekiq_6.1,
rails_6.0_sidekiq_6.2,
rails_6.0_sidekiq_6.3,
rails_6.0_sidekiq_6.4,
rails_6.1_sidekiq_5.2,
rails_6.1_sidekiq_6.0,
rails_6.1_sidekiq_6.1,
rails_6.1_sidekiq_6.2,
rails_6.1_sidekiq_6.3,
rails_6.1_sidekiq_6.4,
rails_6.1_sidekiq_6.4_ddtrace_0.x,
rails_6.1_sidekiq_6.4_ddtrace_1.0]
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/sidekiq_publisher_test
PGHOST: 127.0.0.1
PGUSER: postgres
REDIS_URL: redis://localhost:6379
RAILS_ENV: test
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
services:
postgres:
image: postgres:12.6
env:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: sidekiq_publisher_test
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:6.0.20-alpine
options: >-
--health-cmd "redis-cli ping | grep PONG"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
- name: Install dependencies from ${{ matrix.gemfile }}
run: bundle install
- name: Run Rspec
run: bundle exec rspec