name: RSpec

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  schedule:
    - cron: "0 21 * * 6"

jobs:
  rspec:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ruby: ["3.0", "3.1", "3.2", "head"]
        activesupport: ["6.1", "7.0", "7.1", "main"]
    env:
      BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/activesupport_${{ matrix.activesupport }}.gemfile

    name: Ruby ${{ matrix.ruby }} and ActiveSupport ${{ matrix.activesupport }}
    steps:
      - uses: actions/checkout@v4
      - run: rm Gemfile.lock
      - run: rm .ruby-version
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - run: bundle exec rspec
      - run: bundle exec standardrb
      - run: bundle exec fasterer