Skip to content

Commit

Permalink
cache php extensions
Browse files Browse the repository at this point in the history
optimize build times by caching php extensions, particularly for 8.4/nightly which otherwise builds extensions from source each time
  • Loading branch information
brettmc committed Jan 13, 2024
1 parent 3928b13 commit 3c0c992
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,38 @@ jobs:
- php-version: 8.4
experimental: true
composer_args: "--ignore-platform-reqs"
env:
extensions: ast, grpc, protobuf

steps:
- name: Set cache key
id: key
run: echo "::set-output name=key::$(date +'%Y-%m-%d')"

- 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: ${{ env.key }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: php-cs-fixer
extensions: "ast, grpc, protobuf"
extensions: ${{ env.extensions }}

- name: Validate composer.json
run: composer validate
Expand Down

0 comments on commit 3c0c992

Please sign in to comment.