From 277b53a970fcb7f56f4dbc28f5562d01e85791b2 Mon Sep 17 00:00:00 2001 From: Nic Wortel Date: Thu, 10 Dec 2020 20:03:47 +0100 Subject: [PATCH] Use the ramsey/composer-install action to install dependencies (#8388) Follow-up of https://github.com/doctrine/.github/pull/16. --- .github/workflows/coding-standard.yml | 11 +--- .github/workflows/continuous-integration.yml | 53 ++++---------------- .github/workflows/static-analysis.yml | 22 ++------ 3 files changed, 17 insertions(+), 69 deletions(-) diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml index 96e802c9b2b..bea24ae8f99 100644 --- a/.github/workflows/coding-standard.yml +++ b/.github/workflows/coding-standard.yml @@ -26,15 +26,8 @@ jobs: php-version: "${{ matrix.php-version }}" tools: "cs2pr" - - name: "Cache dependencies installed with composer" - uses: "actions/cache@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 --no-progress --no-suggest" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Install git-phpcs" run: "wget https://github.com/diff-sniffer/git/releases/download/0.3.2/git-phpcs.phar" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 12623adf05b..703a715421b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,9 +20,9 @@ jobs: - "7.4" - "8.0" deps: - - "normal" + - "highest" include: - - deps: "low" + - deps: "lowest" php-version: "7.3" steps: @@ -39,20 +39,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: "Install 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 -c ci/github/phpunit/sqlite.xml --coverage-clover=coverage-no-cache.xml" @@ -109,15 +99,8 @@ jobs: coverage: "pcov" ini-values: "zend.assertions=1" - - 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 update --no-interaction --no-progress --no-suggest" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Run PHPUnit" run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_pgsql.xml --coverage-clover=coverage.xml" @@ -171,15 +154,8 @@ jobs: ini-values: "zend.assertions=1" extensions: "${{ matrix.extension }}" - - 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 update --no-interaction --no-progress --no-suggest" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Run PHPUnit" run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml" @@ -233,15 +209,8 @@ jobs: ini-values: "zend.assertions=1" extensions: "${{ matrix.extension }}" - - 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 update --no-interaction --no-progress --no-suggest" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Run PHPUnit" run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage-no-cache.xml" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 8e170d7217e..98b66796322 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -24,15 +24,8 @@ jobs: php-version: "${{ matrix.php-version }}" tools: cs2pr - - name: "Cache dependencies installed with composer" - uses: "actions/cache@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-progress --no-suggest --no-interaction --prefer-dist" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Run a static analysis with phpstan/phpstan" run: "php vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr" @@ -56,15 +49,8 @@ jobs: coverage: "none" php-version: "${{ matrix.php-version }}" - - name: "Cache dependencies installed with composer" - uses: "actions/cache@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 --no-progress --no-suggest" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v1" - name: "Run a static analysis with vimeo/psalm" run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)"