Github Action to set up an environment for building and testing PHP extensions on Windows.
Important
This action is superseded by https://github.com/php/setup-php-sdk. Users are strongly encouraged to use this action instead, and to report any issue over there.
- id: setup-php-sdk
uses: cmb69/setup-php-sdk@v0.5
with:
version: 8.0
arch: x64
ts: nts
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
toolset: ${{steps.setup-php-sdk.outputs.toolset}}
- run: phpize
- run: configure --enable-dbase --with-prefix=${{steps.setup-php-sdk.outputs.prefix}}
- run: nmake
- run: nmake test TESTS=tests
version
: the PHP version to build for (7.0
,7.1
,7.2
,7.3
,7.4
,8.0
or8.1
)arch
: the architecture to build for (x64
orx86
)ts
: thread-safety (nts
orts
)deps
: dependency libraries to install; for now, only core dependencies are available
Note that for PHP versions 7.2 and below, runs-on: windows-2022
will not work
as the correct toolset is not available. For these versions, you should use
runs-on: windows-2019
. For example:
strategy:
matrix:
os: [ windows-2019, windows-2022 ]
php: [ "8.1", "8.0", "7.4", "7.3", "7.2", "7.1" ]
arch: [ x64, x86 ]
ts: [ ts, nts ]
exclude:
- { os: windows-2019, php: "8.1" }
- { os: windows-2019, php: "8.0" }
- { os: windows-2019, php: "7.4" }
- { os: windows-2019, php: "7.3" }
- { os: windows-2022, php: "7.2" }
- { os: windows-2022, php: "7.1" }
Currently, windows-2019
may be used for all PHP versions, although this may
change in future releases.
toolset
: the required toolset version; needs to be passed to the ilammy/msvc-dev-cmd actionprefix
: the prefix of the PHP installation; needs to be passed to configurevs
: the Visual Studio version