Skip to content

Commit

Permalink
Merge pull request #131 from bendavies/github-actions-composer-cache
Browse files Browse the repository at this point in the history
GitHub Actions: cache composer dependencies
  • Loading branch information
localheinz authored Nov 5, 2019
2 parents bce08f8 + b3b298a commit a99ff5d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit a99ff5d

Please sign in to comment.