name: Continuous Integration

on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main

jobs:
  ci:
    name: 'Ruby: ${{ matrix.ruby_version }} • Faraday: ~> ${{ matrix.faraday_version }}'
    runs-on: ${{ matrix.os }}
    env:
      FARADAY_VERSION: ${{ matrix.faraday_version }}
    strategy:
      fail-fast: false
      matrix:
        ruby_version:
        - '2.7'
        - '3.0'
        - '3.1'
        - '3.2'
        faraday_version:
        - '1.0'
        - '2.0'
        os:
        - ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby_version }}
          bundler-cache: true # runs 'bundle install' and caches installed gems automatically
      - run: script/cibuild
