rootstrap/active-storage-base64

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: CI

on:
  pull_request:
  push:
    branches: [master]

jobs:
  build:
    if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
    runs-on: ubuntu-latest
    strategy:
      matrix:
        gemfile: [rails_7_1.gemfile, rails_head.gemfile]
        ruby_version: ['2.7', '3.0', '3.1', '3.2']
        exclude:
          - gemfile: rails_head.gemfile
            ruby_version: '2.7'
          - gemfile: rails_head.gemfile
            ruby_version: '3.0'
    env:
      BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}
      CC_TEST_REPORTER_ID: 7196b4aa257fde33f24463218af32db6a6efd23d9148204822f757fa614a093e
    steps:
    - uses: actions/checkout@v4
    - name: Setup Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby_version }}
    - name: Before build
      run: |
        sudo apt-get install libsqlite3-dev
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
        chmod +x ./cc-test-reporter
        ./cc-test-reporter before-build
    - name: Build and test with Rake
      run: |
        gem install bundler -v 2.4.22
        bundle update
        bundle install --gemfile gemfiles/${{ matrix.gemfile }} --jobs 4 --retry 3
        bundle exec rake code_analysis
        bundle exec rspec
    - name: Report to CodeClimate
      run: |
        ./cc-test-reporter after-build --exit-code 0