tpitale/mail_room

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest

    services:
      # Label used to access the service container
      redis:
        # Docker Hub image
        image: redis
        # Set health checks to wait until redis has started
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps port 6379 on service container to the host
          - 6379:6379

    strategy:
      fail-fast: false
      matrix:
        ruby-version:
          - head
          - '3.2'
          - '3.1'
          - '3.0'
          - '2.7'
    steps:
    - uses: actions/checkout@v4
    - name: Set up Ruby ${{ matrix.ruby-version }}
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby-version }}
        bundler-cache: true # 'bundle install' and cache
    - name: Run tests
      run: bundle exec rspec

  rubocop:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Ruby ${{ matrix.ruby-version }}
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby-version }}
        bundler-cache: true # 'bundle install' and cache
    - name: Run Rubocop
      run: bundle exec rubocop