Skip to content

Commit

Permalink
don't cache vendor dir but actual composer cache directory itself
Browse files Browse the repository at this point in the history
  • Loading branch information
mikey179 committed Feb 18, 2020
1 parent 04c3aec commit 140f7b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-node-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-node-
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: PHPStan
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/runTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-node-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-node-
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run test suite
Expand Down

0 comments on commit 140f7b3

Please sign in to comment.