Skip to content

Commit

Permalink
Update shivammathur/setup-php to v2 and add cache for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Feb 23, 2020
1 parent b16acc0 commit 5ce0c6a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
run-tests:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
env:
extensions: mbstring, intl, json, phalcon4, mysql, pgsql
key: cache-v1.2
services:
mysql:
image: mysql:5.7
Expand All @@ -27,12 +30,27 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, json, phalcon4, mysql, pgsql
pecl: true
extensions: ${{ env.extensions }}
tools: pecl

- name: Get Composer Cache Directory
id: composer-cache
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
validate-code-static:
name: Static Code with PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
env:
extensions: mbstring, intl, json, phalcon4
key: cache-v1.2
needs: validate-code-style
strategy:
fail-fast: false
Expand All @@ -40,12 +43,27 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v1

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, json, phalcon4
pecl: true
extensions: ${{ env.extensions }}
tools: pecl

- name: Get Composer Cache Directory
id: composer-cache
Expand Down

0 comments on commit 5ce0c6a

Please sign in to comment.