
name: "Backward Compatibility Check"

on:
  pull_request:
    branches:
      - "*.x"
    paths:
      - .github/workflows/bc-check.yml
      - src/**
  push:
    branches:
      - "*.x"
    paths:
      - .github/workflows/bc-check.yml
      - src/**

jobs:
  roave_bc_check:
    name: "Roave BC Check"
    runs-on: "ubuntu-22.04"
    steps:
      - uses: "actions/checkout@v4"
        with:
          fetch-depth: 0

      - name: Install PHP with extensions.
        uses: shivammathur/setup-php@v2
        with:
          php-version: "8.2"

      - name: Install roave/backward-compatibility-check.
        run: composer require --dev roave/backward-compatibility-check

      - name: Run roave/backward-compatibility-check.
        run: vendor/bin/roave-backward-compatibility-check --format=github-actions
