From 414fb0a9348a86916280bd6774e9bda7867e69b4 Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Thu, 22 Dec 2022 15:22:54 +0100 Subject: [PATCH] Simplify `composer install` in GithubActions For reference see https://github.com/ramsey/composer-install No need to add `--no-interaction` and `--no-progress` explicitly and caching is done internally. --- .github/workflows/coding-standards.yml | 11 +++-------- .github/workflows/static-analysis.yml | 11 +++-------- .github/workflows/tests.yml | 11 +++-------- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 06b999ced..7ce7ca500 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -54,15 +54,10 @@ jobs: - name: "Show driver information" run: "php --ri mongodb" - - 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@2.2.0" + with: + composer-options: "--no-suggest" # The -q option is required until phpcs v4 is released - name: "Run PHP_CodeSniffer" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index a1a09ca43..52c49a04b 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -54,15 +54,10 @@ jobs: - name: "Show driver information" run: "php --ri mongodb" - - 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@2.2.0" + with: + composer-options: "--no-suggest" - name: "Run Psalm" run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3372df4c..319ee5088 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -99,15 +99,10 @@ jobs: - name: "Show driver information" run: "php --ri mongodb" - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2" + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@2.2.0" 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" + composer-options: "--no-suggest" - name: "Run PHPUnit" run: "vendor/bin/simple-phpunit -v"