name: Ruby

on: [pull_request]

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        ruby: [2.5, 2.6, 2.7, 3.0, jruby]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - name: Run the default task
      run: |
        bundle exec rake clobber clean test build
        gem install --no-document "$(ls pkg/snappy-*.gem)"
        cat <<EOF | ruby
        require "snappy"
        if Snappy.inflate(Snappy.deflate(File.read("README.md"))) == File.read("README.md")
          puts "OK"
          exit 0
        else
          puts "NG"
          exit 0
        end
        EOF

name: Ruby

on: [pull_request]

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        ruby: [2.5, 2.6, 2.7, 3.0, 3.1, jruby]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - name: Run the default task
      run: |
        bundle exec rake clobber clean test build
        gem install --no-document "$(ls pkg/snappy-*.gem)"
        cat <<EOF | ruby
        require "snappy"
        if Snappy.inflate(Snappy.deflate(File.read("README.md"))) == File.read("README.md")
          puts "OK"
          exit 0
        else
          puts "NG"
          exit 0
        end
        EOF

Add Ruby 3.1 to tests
Add Ruby 3.1 to tests