name: Tests

on:
  pull_request:
    branches:
      - master
    paths-ignore:
      - 'README.md'
      - 'CHANGELOG.markdown'
  push:
    branches:
      - master
    paths-ignore:
      - 'README.md'
      - 'CHANGELOG.markdown'

jobs:
  unit_tests:
    name: Unit Tests
    if: "contains(github.event.commits[0].message, '[ci skip]') == false"
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu
        ruby:
          - "3.3"
          - "3.2"
          - "3.1"
          - "3.0"
        test_command:
          - "bundle exec rspec && bundle exec cucumber"
    runs-on: ${{ matrix.os }}-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - name: Test
        run: ${{ matrix.test_command }}
