From a2102dd09496e386efbcece52bf3012083994648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Reyrol?= Date: Fri, 12 Jan 2024 15:01:23 +0100 Subject: [PATCH] feat: add Roave Backwards Compatibility Check Includes a composer script and a new Github Action workflow --- .github/workflows/roave-bc-check.yml | 41 ++++++++++++++++++++++++++++ composer.json | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/roave-bc-check.yml diff --git a/.github/workflows/roave-bc-check.yml b/.github/workflows/roave-bc-check.yml new file mode 100644 index 0000000..87cc744 --- /dev/null +++ b/.github/workflows/roave-bc-check.yml @@ -0,0 +1,41 @@ +name: Roave Backwards Compatibility Check +on: + push: + pull_request: +jobs: + check: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v9 + - name: Setup Cachix + uses: cachix/cachix-action@v13 + with: + name: opentelemetry + extraPullNames: nix-shell, php-src-nix + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Setup Nix magic cache + uses: DeterminateSystems/magic-nix-cache-action@v2 + - name: Instantiate Nix develop + uses: nicknovitski/nix-develop@v1 + - name: Get composer cache directory + id: composercache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + - name: List PHP installed extensions + run: php -m + - name: Update project dependencies + run: | + composer update --no-interaction --no-progress --ansi + - name: Check for BC breaks + run: composer bc-checks diff --git a/composer.json b/composer.json index 26975b1..f53962a 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ "phpstan": "@php vendor/bin/phpstan analyse", "phpunit": "@php vendor/bin/phpunit", "check-reqs": "@php vendor/bin/composer-require-checker check", + "check-bcs": "@php vendor/bin/roave-backward-compatibility-check --format=github-actions", "lint": [ "@php-cs-fixer:lint", "@phpstan" @@ -80,6 +81,7 @@ "phpstan/phpstan-symfony": "^1.3", "phpunit/phpunit": "^9.6", "pyrech/composer-changelogs": "^2.1", + "roave/backward-compatibility-check": "^8.6", "roave/security-advisories": "dev-master", "symfony/framework-bundle": "^6.4 || ^7.0", "symfony/http-kernel": "^6.4 || ^7.0",