Added cache for PHP extensions in CI pipeline

This commit is contained in:
Alejandro Celaya 2022-08-12 20:32:16 +02:00
parent 6654f45cb8
commit d7d0e11f2c
4 changed files with 63 additions and 4 deletions

View File

@ -16,6 +16,7 @@ jobs:
php-version: [ '8.1' ]
env:
LC_ALL: C
extensions: openswoole-4.11.1, pdo_sqlsrv-5.10.1
steps:
- name: Checkout code
uses: actions/checkout@v2
@ -25,12 +26,25 @@ jobs:
- name: Start database server
if: ${{ inputs.platform != 'sqlite:ci' }}
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_${{ inputs.platform }}
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: db-tests-extensions
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: openswoole-4.11.1, pdo_sqlsrv-5.10.1
extensions: ${{ env.extensions }}
coverage: pcov
ini-values: pcov.directory=module
- name: Install dependencies

View File

@ -14,15 +14,30 @@ jobs:
strategy:
matrix:
php-version: [ '8.1' ]
env:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: mutation-tests-extensions
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: openswoole-4.11.1
extensions: ${{ env.extensions }}
coverage: pcov
ini-values: pcov.directory=module
- name: Install dependencies

View File

@ -14,6 +14,8 @@ jobs:
strategy:
matrix:
php-version: ['8.1']
env:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
@ -23,12 +25,25 @@ jobs:
- name: Start maria database server
if: ${{ inputs.test-group == 'cli' }}
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_maria
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: tests-extensions
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: openswoole-4.11.1
extensions: ${{ env.extensions }}
coverage: pcov
ini-values: pcov.directory=module
- name: Install dependencies

View File

@ -15,15 +15,30 @@ jobs:
matrix:
php-version: ['8.1']
command: ['cs', 'stan', 'swagger:validate']
env:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: tests-extensions
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: openswoole-4.11.1
extensions: ${{ env.extensions }}
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist