From 25de9cbacc99053d133b9d7a45d2b6fdb52d5349 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 7 Dec 2023 11:28:12 +0100 Subject: [PATCH] Update build-project-actions.yml --- .github/workflows/build-project-actions.yml | 30 +++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-project-actions.yml b/.github/workflows/build-project-actions.yml index 45101d2..8f99b19 100644 --- a/.github/workflows/build-project-actions.yml +++ b/.github/workflows/build-project-actions.yml @@ -3,14 +3,34 @@ on: [push] jobs: phpunit: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - uses: php-actions/composer@v6 + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + extensions: mbstring + coverage: xdebug + tools: composer:v2, php-cs-fixer, phpunit + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 with: - php_version: "8.1" + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --prefer-dist + - name: Run PHPCS run: ./vendor/bin/phpcs src -v --standard=PSR2 --exclude=Generic.Files.LineLength + - name: Run PHPUnit run: ./vendor/bin/phpunit --coverage-text --colors