mirror of
https://github.com/flarum/core.git
synced 2025-08-10 18:35:56 +02:00
Cache composer dependencies, skip installing dependencies if cache was used
This commit is contained in:
17
.github/workflows/test.yml
vendored
17
.github/workflows/test.yml
vendored
@@ -43,7 +43,21 @@ jobs:
|
|||||||
name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}'
|
name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Get Composer Cache Directory
|
||||||
|
id: composer-cache
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- uses: actions/cache@v1
|
||||||
|
id: cache
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-composer-
|
||||||
|
|
||||||
- name: Select PHP version
|
- name: Select PHP version
|
||||||
run: sudo update-alternatives --set php $(which php${{ matrix.php }})
|
run: sudo update-alternatives --set php $(which php${{ matrix.php }})
|
||||||
@@ -52,6 +66,7 @@ jobs:
|
|||||||
run: mysql -uroot -proot -e 'CREATE DATABASE flarum_test;' --port 13306
|
run: mysql -uroot -proot -e 'CREATE DATABASE flarum_test;' --port 13306
|
||||||
|
|
||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: composer install
|
run: composer install
|
||||||
|
|
||||||
- name: Setup Composer tests
|
- name: Setup Composer tests
|
||||||
|
Reference in New Issue
Block a user