
name: "Dev dependencies stability check"

on:
  schedule:
    - cron: "0 0 * * 0"

jobs:
  phpunit:
    name: "PHPUnit"
    runs-on: "ubuntu-22.04"
    env:
      SYMFONY_REQUIRE: ${{matrix.symfony-require}}

    strategy:
      fail-fast: false
      matrix:
        php-version:
          - "8.2"
        dependencies:
          - "highest"
        stability:
          - "dev"
        symfony-require:
          - ""
          - "6.*"

    steps:
      - name: "Checkout"
        uses: "actions/checkout@v4"
        with:
          fetch-depth: 2

      - name: "Install PHP"
        uses: "shivammathur/setup-php@v2"
        with:
          php-version: "${{ matrix.php-version }}"
          ini-values: "zend.assertions=1"
          extensions: "pdo_sqlite"
          tools: "flex"

      - name: "Require symfony/messenger"
        run: "composer require --dev symfony/messenger --no-update"
        if: "${{ startsWith(matrix.symfony-require, '4.') }}"

      - name: "Install dependencies with Composer"
        uses: "ramsey/composer-install@v2"
        with:
          dependency-versions: "${{ matrix.dependencies }}"
          composer-options: "--prefer-dist"

      - name: "Run PHPUnit"
        run: "vendor/bin/phpunit"
