Skip to content

Commit

Permalink
GH Actions: enable Composer caching
Browse files Browse the repository at this point in the history
... by using the `ramsey/composer-install` action.

This means that the Composer downloads directory for dependencies will be cached and restored on each build. This conserves resources and should also make builds faster.

Ref: https://github.com/marketplace/actions/install-composer-dependencies
  • Loading branch information
jrfnl committed Aug 8, 2021
1 parent e386675 commit 6ab88bd
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ jobs:
tools: psalm, phpunit:${{ matrix.phpunit-versions }}
coverage: none

- name: Install dependencies
run: composer self-update --1; composer install
- name: Use Composer 1.x
run: composer self-update --1

- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: PHPUnit tests
uses: php-actions/phpunit@v2
Expand Down Expand Up @@ -53,11 +56,11 @@ jobs:
tools: psalm, phpunit:${{ matrix.phpunit-versions }}
coverage: none

- name: Install dependencies
run: composer install

- name: Modernize dependencies
run: composer require --dev "phpunit/phpunit:>=4"
run: composer require --dev --no-update "phpunit/phpunit:>=4"

- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: PHPUnit tests
uses: php-actions/phpunit@v2
Expand Down Expand Up @@ -86,11 +89,11 @@ jobs:
tools: psalm, phpunit:${{ matrix.phpunit-versions }}
coverage: none

- name: Install dependencies
run: composer install

- name: Modernize dependencies
run: composer require --dev "phpunit/phpunit:>=4"
run: composer require --dev --no-update "phpunit/phpunit:>=4"

- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: PHPUnit tests
uses: php-actions/phpunit@v2
Expand Down

0 comments on commit 6ab88bd

Please sign in to comment.