Skip to content

Commit

Permalink
Use caching
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Nov 6, 2019
1 parent bdf9cf2 commit 09ae6c6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@master

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: nanasess/setup-php@master
with:
Expand Down Expand Up @@ -105,6 +117,17 @@ jobs:
with:
php-version: ${{ matrix.php }}

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install to Composer
run: composer install --no-interaction -o

Expand Down Expand Up @@ -145,6 +168,19 @@ jobs:
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: actions/checkout@master

- name: Get Composer Cache Directory
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install to Composer
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
run: composer install --no-scripts --no-dev --no-interaction --optimize-autoloader
Expand Down

0 comments on commit 09ae6c6

Please sign in to comment.