From f375576c43fac656cfa2b1d263b46c79cc90cfb0 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 31 Dec 2025 11:41:05 +0000 Subject: [PATCH] added workflow --- .github/workflows/php.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8f7d314..03bca5b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -2,38 +2,42 @@ name: PHP Composer on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] permissions: contents: read jobs: build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Setup PHP 8.4 + uses: shivammathur/setup-php@v2 + with: + php-version: "8.4" + tools: composer:v2 + coverage: none + - name: Validate composer.json and composer.lock run: composer validate --strict - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + path: | + vendor + ~/.composer/cache/files + key: ${{ runner.os }}-php-8.4-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-php- + ${{ runner.os }}-php-8.4-composer- - name: Install dependencies - run: composer install --prefer-dist --no-progress - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md + run: composer install --prefer-dist --no-progress --no-interaction - name: Run test suite run: composer run-script test