From fef53c865e8a38163b798b53a7f8e9e0db1e9e0c Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 1 Mar 2024 12:36:24 -0700 Subject: [PATCH] Use composer install action --- .github/workflows/pull-request.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index cd4f476..45a36ee 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,6 +4,9 @@ on: pull_request: workflow_dispatch: +env: + COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}' + jobs: phpcs: name: Test (PHP ${{ matrix.php-versions }}) @@ -19,18 +22,13 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} + - name: Validate Composer run: composer validate - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: Composer install - run: composer install + + - name: Install Composer dependencies + uses: ramsey/composer-install@v2 + - name: Detect File Changes uses: dorny/paths-filter@v2 id: filter @@ -39,10 +37,10 @@ jobs: filters: | src: - added|modified: 'src/**/*.php' + - name: PHP CodeSniffer if: ${{ steps.filter.outputs.src == 'true' }} - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} run: ./vendor/bin/phpcs ${{ steps.filter.outputs.src_files }} + - name: Unit testing run: ./vendor/bin/phpunit