-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from bendavies/github-actions-composer-cache
GitHub Actions: cache composer dependencies
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,14 @@ jobs: | |
- name: "Validate composer.json and composer.lock" | ||
run: php7.2 $(which composer) validate --strict | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.composer/cache | ||
key: php7.2-composer-locked-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
php7.2-composer-locked- | ||
- name: "Install locked dependencies with composer" | ||
run: php7.2 $(which composer) install --no-interaction --no-progress --no-suggest | ||
|
||
|
@@ -43,6 +51,14 @@ jobs: | |
- name: "Disable Xdebug" | ||
run: php7.3 --ini | grep xdebug | sed 's/,$//' | xargs sudo rm | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.composer/cache | ||
key: php7.3-composer-locked-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
php7.3-composer-locked- | ||
- name: "Install locked dependencies with composer" | ||
run: php7.3 $(which composer) install --no-interaction --no-progress --no-suggest | ||
|
||
|
@@ -72,6 +88,14 @@ jobs: | |
- name: "Disable Xdebug" | ||
run: ${{ matrix.php-binary }} --ini | grep xdebug | sed 's/,$//' | xargs sudo rm | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.composer/cache | ||
key: ${{ matrix.php-binary }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ matrix.php-binary }}-composer-${{ matrix.dependencies }}- | ||
- name: "Install lowest dependencies with composer" | ||
if: matrix.dependencies == 'lowest' | ||
run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest | ||
|
@@ -102,6 +126,14 @@ jobs: | |
- name: "Checkout" | ||
uses: actions/checkout@master | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.composer/cache | ||
key: php7.3-composer-locked-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
php7.3-composer-locked- | ||
- name: "Install locked dependencies with composer" | ||
run: php7.3 $(which composer) install --no-interaction --no-progress --no-suggest | ||
|
||
|
@@ -126,6 +158,14 @@ jobs: | |
- name: "Checkout" | ||
uses: actions/checkout@master | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.composer/cache | ||
key: php7.3-composer-locked-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
php7.3-composer-locked- | ||
- name: "Install locked dependencies with composer" | ||
run: php7.3 $(which composer) install --no-interaction --no-progress --no-suggest | ||
|
||
|