Merge pull request #1508 from acelaya-forks/feature/improve-cache-key-ci

Improved cache keys for extensions in CI workflow to support several …
This commit is contained in:
Alejandro Celaya 2022-08-13 10:27:13 +02:00 committed by GitHub
commit 67b393d4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 16 deletions

View File

@ -19,7 +19,7 @@ jobs:
extensions: openswoole-4.11.1, pdo_sqlsrv-5.10.1
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install MSSQL ODBC
if: ${{ inputs.platform == 'ms' }}
run: sudo ./data/infra/ci/install-ms-odbc.sh
@ -32,7 +32,7 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: db-tests-extensions-${{ inputs.platform }}
key: db-tests-extensions-${{ matrix.php-version }}-${{ inputs.platform }}
- name: Cache extensions
uses: actions/cache@v2
with:

View File

@ -18,14 +18,14 @@ jobs:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: mutation-tests-extensions-${{ inputs.test-group }}
key: mutation-tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
- name: Cache extensions
uses: actions/cache@v2
with:

View File

@ -18,7 +18,7 @@ jobs:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Start postgres database server
if: ${{ inputs.test-group == 'api' }}
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
@ -31,7 +31,7 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: tests-extensions-${{ inputs.test-group }}
key: tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
- name: Cache extensions
uses: actions/cache@v2
with:

View File

@ -19,14 +19,14 @@ jobs:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: tests-extensions-${{ matrix.command }}
key: tests-extensions-${{ matrix.php-version }}-${{ matrix.command }}
- name: Cache extensions
uses: actions/cache@v2
with:
@ -124,7 +124,7 @@ jobs:
php-version: ['8.1']
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
@ -166,7 +166,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: marceloprado/has-changed-path@v1

View File

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx

View File

@ -12,15 +12,30 @@ jobs:
matrix:
php-version: ['8.1']
swoole: ['yes', 'no']
env:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: publish-release-extensions-${{ matrix.php-version }}-${{ matrix.swoole }}
- 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 }}
- if: ${{ matrix.swoole == 'yes' }}
run: ./build.sh ${GITHUB_REF#refs/tags/v}
- if: ${{ matrix.swoole == 'no' }}
@ -35,7 +50,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: build

View File

@ -11,19 +11,34 @@ jobs:
strategy:
matrix:
php-version: ['8.1']
env:
extensions: openswoole-4.11.1
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Determine version
id: determine_version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
shell: bash
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: publish-swagger-spec-extensions-${{ matrix.php-version }}
- 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
- run: composer install --no-interaction --prefer-dist
- run: composer swagger:inline