Skip to content

Commit 49f3e3d

Browse files
authored
Simplify composer install in Github Actions (#1018)
For reference see https://github.com/ramsey/composer-install No need to add `--no-interaction` and `--no-progress` explicitly and caching is done internally.
1 parent fc4a879 commit 49f3e3d

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

.github/workflows/coding-standards.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,10 @@ jobs:
5454
- name: "Show driver information"
5555
run: "php --ri mongodb"
5656

57-
- name: "Cache dependencies installed with Composer"
58-
uses: "actions/cache@v2"
59-
with:
60-
path: "~/.composer/cache"
61-
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
62-
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
63-
6457
- name: "Install dependencies with Composer"
65-
run: "composer install --no-interaction --no-progress --no-suggest"
58+
uses: "ramsey/[email protected]"
59+
with:
60+
composer-options: "--no-suggest"
6661

6762
# The -q option is required until phpcs v4 is released
6863
- name: "Run PHP_CodeSniffer"

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,10 @@ jobs:
5454
- name: "Show driver information"
5555
run: "php --ri mongodb"
5656

57-
- name: "Cache dependencies installed with Composer"
58-
uses: "actions/cache@v2"
59-
with:
60-
path: "~/.composer/cache"
61-
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
62-
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
63-
6457
- name: "Install dependencies with Composer"
65-
run: "composer install --no-interaction --no-progress --no-suggest"
58+
uses: "ramsey/[email protected]"
59+
with:
60+
composer-options: "--no-suggest"
6661

6762
- name: "Run Psalm"
6863
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)"

.github/workflows/tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,10 @@ jobs:
9999
- name: "Show driver information"
100100
run: "php --ri mongodb"
101101

102-
- name: "Cache dependencies installed with composer"
103-
uses: "actions/cache@v2"
102+
- name: "Install dependencies with Composer"
103+
uses: "ramsey/[email protected]"
104104
with:
105-
path: "~/.composer/cache"
106-
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
107-
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
108-
109-
- name: "Install dependencies with composer"
110-
run: "composer update --no-interaction --no-progress"
105+
composer-options: "--no-suggest"
111106

112107
- name: "Run PHPUnit"
113108
run: "vendor/bin/simple-phpunit -v"

0 commit comments

Comments
 (0)