mirror of
https://github.com/php/setup-php-sdk.git
synced 2026-03-24 15:22:13 +01:00
For now we cache only the PHP SDK, the PHP binaries and the development packs. This already greatly improves the setup performance (it might easily safe a minute or two, in case of cache hits). To be able to use the current PHP revision as part of the cache key, we factor out determine-revision.ps1. We create a separate cache for the PHP-SDK since this likely rarely changes, and since the cached variant is apparently much faster than fetching a GH release of the PHP-SDK. Since clients may not want to use the cache, possibly because they have already a lot of other files in their caches, we explicitly require clients to opt-in via the `cache` input parameter.
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: 'Setup PHP-SDK Action'
|
|
description: "Setup Windows build environment for PHP extensions"
|
|
inputs:
|
|
version:
|
|
description: "PHP version to build for"
|
|
required: true
|
|
arch:
|
|
description: "The architecture to build for (x64 or x86)"
|
|
required: true
|
|
ts:
|
|
description: "Thread-safety (nts or ts)"
|
|
required: true
|
|
deps:
|
|
description: "List of dependency libraries"
|
|
required: false
|
|
default: '@()'
|
|
cache:
|
|
description: "Whether the PHP-SDK should be cached"
|
|
type: boolean
|
|
required: false
|
|
default: false
|
|
outputs:
|
|
toolset:
|
|
description: "The required toolset version"
|
|
value: ${{steps.setup.outputs.toolset}}
|
|
prefix:
|
|
description: "The prefix of the PHP installation"
|
|
value: ${{steps.setup.outputs.prefix}}
|
|
vs:
|
|
description: "The Visual Studio version"
|
|
value: ${{steps.setup.outputs.vs}}
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Determine current PHP revision
|
|
id: revision
|
|
run: ${{github.action_path}}/determine-revision -version ${{inputs.version}}
|
|
shell: powershell
|
|
- name: Cache PHP SDK
|
|
if: ${{inputs.cache == 'true'}}
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: php-sdk
|
|
key: php-sdk-2.3.0
|
|
- name: Cache PHP
|
|
if: ${{inputs.cache == 'true'}}
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
php-bin
|
|
php-dev
|
|
key: php-${{steps.revision.outputs.version}}-${{inputs.arch}}-${{inputs.ts}}
|
|
- id: setup
|
|
run: ${{github.action_path}}/run -version ${{inputs.version}} -revision ${{steps.revision.outputs.version}} -baseurl ${{steps.revision.outputs.baseurl}} -arch ${{inputs.arch}} -ts ${{inputs.ts}} -deps ${{inputs.deps}}
|
|
shell: powershell
|