From fd7683d53ee3bcd49163f8d9c07f6ff59d56f7a2 Mon Sep 17 00:00:00 2001 From: Nic Wortel Date: Thu, 10 Dec 2020 19:54:57 +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 | 20 +++++--------------- .github/workflows/static-analysis.yml | 11 ++--------- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 7df688992..a548d01d5 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -24,15 +24,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 d81974cc7..7a344bd21 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -24,9 +24,9 @@ jobs: - "7.4" - "8.0" deps: - - "normal" + - "highest" include: - - deps: "low" + - deps: "lowest" php-version: "7.2" steps: @@ -42,20 +42,10 @@ jobs: coverage: "pcov" 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: "Update dependencies with composer" - run: "composer update --no-interaction --no-progress --no-suggest" - if: "${{ matrix.deps == 'normal' }}" - - - name: "Install lowest possible dependencies with composer" - run: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-lowest" - if: "${{ matrix.deps == 'low' }}" + dependency-versions: "${{ matrix.deps }}" - name: "Run PHPUnit" run: "vendor/bin/phpunit" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index eca2fe87e..7be649809 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -31,15 +31,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" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Run a static analysis with phpstan/phpstan" run: "vendor/bin/phpstan analyse -l 3 -c phpstan.neon --error-format=checkstyle lib/ tests/ | cs2pr"