From ac11dcfe40470a26aae9617ad6957a2fa9890973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Mon, 20 Mar 2023 20:07:52 +0100 Subject: [PATCH] Enable BC-break check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luís Cobucci --- .github/workflows/backwards-compatibility.yml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/backwards-compatibility.yml diff --git a/.github/workflows/backwards-compatibility.yml b/.github/workflows/backwards-compatibility.yml new file mode 100644 index 00000000..b53e6ee8 --- /dev/null +++ b/.github/workflows/backwards-compatibility.yml @@ -0,0 +1,43 @@ +name: "Backwards compatibility check" + +on: + pull_request: + +jobs: + bc-check: + name: "Backwards compatibility check" + + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v3" + with: + fetch-depth: 0 + + - name: "Install PHP" + uses: "shivammathur/setup-php@2.24.0" + with: + php-version: "8.2" + ini-values: memory_limit=-1 + tools: composer:v2, cs2pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composer-cache + run: echo "composer_cache_dir=$(composer global config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: "Cache dependencies" + uses: "actions/cache@v3.3.1" + with: + path: ${{ steps.composer-cache.outputs.composer_cache_dir }} + key: "php-8.2-bc-break-check-${{ hashFiles('.github/workflows/backwards-compatibility.yml') }}" + restore-keys: "php-8.2-bc-break-check-" + + - name: "Install dependencies" + run: composer global require roave/backward-compatibility-check + + - name: "BC Check" + run: | + ~/.composer/vendor/bin/roave-backward-compatibility-check --from=${{ github.event.pull_request.base.sha }} --format=github-actions