name: Run default rake task (tests) on PRs and main rebases

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.7
    - name: Install dependencies
      run: bundle install
    - name: Run tests (and linting)
      run: bundle exec rake

Add GitHub action to run tests on merges
Add GitHub action to run tests on merges

Runs on both new PRs and after merges to main.
