.github/workflows/ruby.yml

Summary

Maintainability
Test Coverage
name: Ruby

on: [push]

jobs:
  build:
    runs-on: ubuntu-18.04
    strategy:
      matrix:
        ruby: ['2.5', '2.6', '2.7', '3.0']
    name: Ruby ${{ matrix.ruby }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: Setup Code Climate test-reporter
        run: |
          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: Install Gems
        run: |
          gem install bundler
          bundle install --jobs 4 --retry 3

      - name: Run tests
        run: |
          git config --global user.email "github_actions@test.com"
          git config --global user.name "Github Actions Test"
          bundle exec rake

      - name: Publish code coverage
        run: |
          export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
          ./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}

  lint:
    runs-on: ubuntu-18.04
    name: Lint
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-ruby@v1
        with:
          ruby-version: '2.5'
      - name: Install Gems
        run: |
          gem install bundler
          bundle install --jobs 4 --retry 3
      - name: Running Rubocop
        run: |
          bundle exec rubocop