Skip to content

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

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

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

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
env:
app: sidekiq_publisher
DATABASE_URL: postgres://ci@postgres/test
REDIS_URL: redis://redis:6379/1
RAILS_ENV: test
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 (Rails ${{ matrix.rails }}, Sidekiq ${{ matrix.sidekiq }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rails: [ '5.1', '5.2', '6.0', '6.1', '7.0', '7.1' ]
sidekiq: [ '5.2', '6.0', '6.1', '6.2', '6.3', '6.4' ]
services:
postgres:
image: postgres:12.6
env:
POSTGRES_USER: ci
POSTGRES_DB: test
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:5.0.9-alpine
options: >-
--health-cmd "redis-cli ping | grep PONG"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
- name: Install dependencies
run: bundle install
- name: Install appraisal
run: bundle exec appraisal install
- name: Appraise (Rails ${{ matrix.rails }}, Sidekiq ${{ matrix.sidekiq }})
run: bundle exec appraisal rails-${{ matrix.rails }}-sidekiq-${{ matrix.sidekiq }} rspec
test-ddtrace:
name: Test with ddtrace (Rails ${{ matrix.rails }}, Sidekiq ${{ matrix.sidekiq }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ddtrace: [ '0.x', '1.0' ]
services:
postgres:
image: postgres:12.6
env:
POSTGRES_USER: ci
POSTGRES_DB: test
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:5.0.9-alpine
options: >-
--health-cmd "redis-cli ping | grep PONG"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
- name: Install dependencies
run: bundle install
- name: Install appraisal
run: bundle exec appraisal install
- name: Appraise (Rails 6.1, Sidekiq 6.4, ddtrace ${{ matrix.ddtrace }})
run: bundle exec appraisal rails-6.1-sidekiq-6.4-ddtrace-${{ matrix.ddtrace }} rspec