-
Notifications
You must be signed in to change notification settings - Fork 9
Note that PHP 7.4 and earlier requires windows-2019 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ for building and testing PHP extensions on Windows. | |
- `deps`: dependency libraries to install; for now, only | ||
[core dependencies](https://windows.php.net/downloads/php-sdk/deps/) are available | ||
|
||
Note that for PHP versions 7.2 and below, `runs-on: windows-2022` will not work | ||
Note that for PHP versions 7.4 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: | ||
|
||
|
@@ -45,15 +45,39 @@ strategy: | |
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.4" } | ||
- { os: windows-2022, 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. | ||
|
||
### Manually Installing Toolsets | ||
|
||
It is possible to manually install older toolsets on `windows-2022` using an | ||
approach suggested in [actions/runner-images#9701](https://github.com/actions/runner-images/issues/9701). | ||
The following example installs VC15 by its | ||
[Component ID](https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022) | ||
to allow building PHP 7.2, 7.3, and 7.4 on a `windows-2022` image: | ||
|
||
```yml | ||
run: | ||
steps: | ||
- name: Install VC15 component | ||
if: ${{ matrix.php == '7.4' || matrix.php == '7.3' || matrix.php == '7.2' }} | ||
shell: pwsh | ||
run: | | ||
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" | ||
$installPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" | ||
$component = "Microsoft.VisualStudio.Component.VC.v141.x86.x64" | ||
$args = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$installPath`"", '--add', $component, '--quiet', '--norestart', '--nocache') | ||
$process = Start-Process -FilePath cmd.exe -ArgumentList $args -Wait -PassThru -WindowStyle Hidden | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: capturing the return value of |
||
``` | ||
|
||
This step should be executed _before_ invoking the `setup-php-sdk` action. | ||
|
||
## Outputs | ||
|
||
- `toolset`: the required toolset version; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.