drapergem/draper

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
---
name: CI

on:
  push:
    branches:
      - master
  pull_request:

permissions:
  contents: read

jobs:
  rspec:
    name: >-
      rspec (${{ matrix.ruby }})

    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        ruby:
          - 3.3
          - 3.2
          - 3.1
        rails:
          - 7.2
        include:
          # Edge
          - { ruby: 'head', rails: 'edge', allow-fail: true }
          # Outdated
          - { ruby: '3.0',  rails: '7.1' }
          - { ruby: '2.7',  rails: '6'   } # RSpec AR Expectations support Rails 7.1 since Ruby 3.0
          - { ruby: '2.6',  rails: '6'   }
          - { ruby: '2.5',  rails: '6'   }
          - { ruby: '2.4',  rails: '5'   }

    env:
      RAILS_VERSION: "${{ matrix.rails }}"

    services:
      mongodb:
        image: mongo
        ports:
          - 27017:27017

    steps:
      - uses: actions/checkout@v4

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          rubygems: latest
          bundler-cache: true

      - name: RSpec & publish code coverage
        uses: paambaati/codeclimate-action@v8
        env:
          CC_TEST_REPORTER_ID: b7ba588af2a540fa96c267b3655a2afe31ea29976dc25905a668dd28d5e88915
        with:
          coverageCommand: bin/rake
        continue-on-error: ${{ matrix.allow-fail }}
        id: test

      - name: >-
          Test ${{ steps.test.outcome }}
        run: |
          echo Ruby  ${{ matrix.ruby  }}
          echo Rails ${{ matrix.rails }}