Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions のキャッシュを追加 #340

Merged
merged 2 commits into from
Nov 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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