From cbae1443f39503bc21713f53ccc21dae8d2a4b76 Mon Sep 17 00:00:00 2001 From: Nic Wortel Date: Thu, 10 Dec 2020 22:24:58 +0100 Subject: [PATCH] Use the ramsey/composer-install action to install dependencies Follow-up of https://github.com/doctrine/.github/pull/16. --- .github/workflows/coding-standards.yml | 9 +------- .github/workflows/continuous-integration.yml | 22 ++++++-------------- .github/workflows/static-analysis.yml | 11 ++-------- 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 06d0aa890..5768a4e72 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -32,15 +32,8 @@ jobs: php-version: "${{ matrix.php-version }}" tools: "cs2pr" - - name: "Cache dependencies installed with Composer" - uses: "actions/cache@v2" - with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - name: "Install dependencies with Composer" - run: "composer install --no-interaction --no-progress --no-suggest" + uses: "ramsey/composer-install@v1" # https://github.com/doctrine/.github/issues/3 - name: "Run PHP_CodeSniffer" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b8a13429e..ef90be884 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -26,10 +26,10 @@ jobs: - "7.4" - "8.0" deps: - - "normal" + - "highest" include: - - deps: "low" - php-version: "7.1" + - php-version: "7.1" + deps: "lowest" steps: - name: "Checkout" @@ -53,20 +53,10 @@ jobs: coverage: "xdebug" ini-values: "zend.assertions=1" - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - - name: "Install dependencies with composer" - run: "composer update --no-interaction --prefer-dist" - if: "${{ matrix.deps == 'normal' }}" - - - name: "Install lowest possible dependencies with composer" - run: "composer update --no-interaction --prefer-dist --prefer-lowest" - if: "${{ matrix.deps == 'low' }}" + dependency-versions: "${{ matrix.deps }}" - name: "Run PHPUnit" run: "vendor/bin/phpunit --coverage-clover=coverage.xml" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 90e5def8c..a2ea0713e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -31,15 +31,8 @@ jobs: coverage: "none" php-version: "${{ matrix.php-version }}" - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2" - with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - - name: "Install dependencies with composer" - run: "composer install --no-interaction --no-progress --no-suggest" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Run a static analysis with phpstan/phpstan" run: "vendor/bin/phpstan analyse"