# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.

name: CI

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the develop branch
  push:
    branches: [ '**' ]
  pull_request:
    branches: [ develop ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  tests:
    name: Ruby ${{ matrix.ruby }}
    if: "contains(github.event.commits[0].message, '[ci skip]') == false"
    runs-on: ubuntu-latest
    env:
      CI: true
      ALLOW_FAILURES: false # ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }}
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - 2.4
          - 2.5
          - 2.6
          - 2.7
          - ruby-head
          - jruby
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - name: Install dependencies
        run: bundle install --jobs 4 --retry 3
      - name: Run tests
        run: bundle exec rspec spec || $ALLOW_FAILURES
 

# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.

name: CI

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the develop branch
  push:
    branches: [ '**' ]
  pull_request:
    branches: [ develop ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  tests:
    name: Ruby ${{ matrix.ruby }}
    if: "contains(github.event.commits[0].message, '[ci skip]') == false"
    runs-on: ubuntu-latest
    env:
      CI: true
      ALLOW_FAILURES: false ${{ endsWith(matrix.ruby, 'head') }}
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - 2.4
          - 2.5
          - 2.6
          - 2.7
          - ruby-head
          - jruby
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - name: Install dependencies
        run: bundle install --jobs 4 --retry 3
      - name: Run tests
        run: bundle exec rspec spec || $ALLOW_FAILURES
 

Allow failure for ruby-head. Awaiting Ruby 3 release of net-http-persistent.
Allow failure for ruby-head. Awaiting Ruby 3 release of net-http-persistent.
