name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ruby: [ '3.2', '3.3', '3.4' ] # , 'ruby-head' ]
        rubyopt: ['']
        include:
          - ruby: '3.4'
            rubyopt: "--enable-frozen-string-literal --debug-frozen-string-literal"

    name: Ruby ${{ matrix.ruby }} tests
    steps:
      - uses: actions/checkout@v2
      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - name: Run tests ${{ matrix.rubyopt }}
        run: bundle exec rake test RUBYOPT="${{ matrix.rubyopt }}"
