From 376b19dd70c0442961bb5e4da219f9c2c20e8539 Mon Sep 17 00:00:00 2001 From: Lukas Rosenfeldt Date: Thu, 8 Aug 2024 14:45:34 +0200 Subject: [PATCH] refactor: add workflow to test older php versions --- .github/workflows/test_backwards.yml | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/test_backwards.yml diff --git a/.github/workflows/test_backwards.yml b/.github/workflows/test_backwards.yml new file mode 100644 index 0000000..3899299 --- /dev/null +++ b/.github/workflows/test_backwards.yml @@ -0,0 +1,45 @@ +name: Run tests against older PHP versions + +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + workflow_dispatch: + workflow_call: + +jobs: + test_backwards: + runs-on: ubuntu-20.04 + strategy: + matrix: + php-version: ['8.2'] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: composer + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + + - name: Install dependencies + run: composer install --no-progress --no-interaction --prefer-dist + + - name: Run tests + run: composer run-script test