name: CI

on: [push]

jobs:
  test:
    strategy:
      matrix:
        ruby_version: [2.6.x, 2.7.x, 3.0.x]
      fail-fast: false
    runs-on: ubuntu-latest
    name: Test on Ruby ${{ matrix.ruby_version }}
    steps:
    - uses: actions/checkout@v2
    - name: Setup Ruby ${{ matrix.ruby_version }}
      uses: actions/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby_version }}
    - name: Install dependencies
      run: bundle install
    - name: Build gem
      run: gem build yajl-ruby.gemspec
    - name: Install gem
      run: gem install yajl-ruby
    - name: Run tests
      run: bundle exec rake spec

name: CI

on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        ruby_version: [2.6.x, 2.7.x, 3.0.x]
      fail-fast: false
    runs-on: ubuntu-latest
    name: Test on Ruby ${{ matrix.ruby_version }}
    steps:
    - uses: actions/checkout@v2
    - name: Setup Ruby ${{ matrix.ruby_version }}
      uses: actions/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby_version }}
    - name: Install dependencies
      run: bundle install
    - name: Build gem
      run: gem build yajl-ruby.gemspec
    - name: Install gem
      run: gem install yajl-ruby
    - name: Run tests
      run: bundle exec rake spec

Make sure actions runs on PRs
Make sure actions runs on PRs

I think we need both, otherwise it will only run on changes pushed to
upstream rather than on forks that open PRs.
