name: rspec

on:
  push:
    branches:
      - *
  pull_request_target:
    types: [opened, edited, synchronize, reopened]
env:
  RACK_ENV: test
  POSTGRES_USERNAME: sequent
  POSTGRES_PASSWORD: sequent
  POSTGRES_DB: sequent_spec_db

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - ruby-version: 3.0.0
            active-star-version: '< 6.1.5'
          - ruby-version: 3.0.0
            active-star-version: '< 6.0.4'
          - ruby-version: 2.7
            active-star-version: '< 6.0.3'

    services:
      postgres:
        image: postgres:12
        env:
          POSTGRES_USER: sequent
          POSTGRES_PASSWORD: sequent
          POSTGRES_DB: sequent_spec_db
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby-version }}
          bundler-cache: true
      - name: Setup database
        run: |
          bundle exec rake db:create
      - name: Run tests
        run: bundle exec rspec

name: rspec

on: [push, pull_request_target]

env:
  RACK_ENV: test
  POSTGRES_USERNAME: sequent
  POSTGRES_PASSWORD: sequent
  POSTGRES_DB: sequent_spec_db

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - ruby-version: 3.0.0
            active-star-version: '< 6.1.5'
          - ruby-version: 3.0.0
            active-star-version: '< 6.0.4'
          - ruby-version: 2.7
            active-star-version: '< 6.0.3'

    services:
      postgres:
        image: postgres:12
        env:
          POSTGRES_USER: sequent
          POSTGRES_PASSWORD: sequent
          POSTGRES_DB: sequent_spec_db
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby-version }}
          bundler-cache: true
      - name: Setup database
        run: |
          bundle exec rake db:create
      - name: Run tests
        run: bundle exec rspec

Simplify `on` values and use the defaults
Simplify `on` values and use the defaults
