-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-2233: Split Windows Builds #1460
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
PHPC-2233: Split Windows Builds #1460
Conversation
id: get-build-dir | ||
shell: cmd | ||
# The last echo command to set the output variable intentionally omits a space between the environment variable | ||
# and the output redirector to avoid a trailing space in the generated output variable. Do not add a space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good comment.
for /F "usebackq tokens=*" %%i in (`get-build-dir.bat`) do set BUILD_DIR=%%i | ||
echo BUILD_DIR=%BUILD_DIR% | ||
@chcp 65001>nul | ||
echo build_dir=%BUILD_DIR%>> %GITHUB_OUTPUT% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this script adapted from another action, or did you come up with this yourself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first two lines were present previously in the steps that publish the DLL as build artifact. The second lines took me a while to figure out, as the syntax to set an output variable for a step depends on the shell being used. This StackOverflow answer ultimately showed me the correct syntax for this to work in cmd.
jobs: | ||
build: | ||
name: "Build Windows DLLs" | ||
runs-on: windows-2022 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to enforce that this is standardized between both jobs?
jobs.<job_id>.runs-on suggests that this can be a variable.
Not sure this is needed since we only have two jobs, but wanted to ask anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the Workflow syntax documentation, the only other place where to put such values is env
. However, values set there can't be arrays, so even though we could reference an environment variable in the matrix definition, we can't set the list of PHP versions in an environment variable to reuse it in both matrixes.
b63096a
to
5fcc821
Compare
PHPC-2233
This pull request adds a new workflow to run tests on Windows, splitting the process into two jobs: one to build the driver and store the built DLL, another to run tests. The previous job sometimes caused issues, as errors while running tests (typically during the setup phase of tests) would cause other builds to be aborted, potentially stopping the compilation before all artifacts were stored. Build artifacts are shared between the builds using the
cache
action to avoid having to unpack and move around build files. For the release builds (and consumption of "nightly" builds), artifacts are created and stored on GitHub for three days as was previously done.To make the release process easier and less error-prone, the workflow also reacts to push tags. This ensures that the windows-release-build workflow will find build artifacts for a tag even when the tagged commit has not been pushed individually. When pushing a tag, tests are not run as they are not necessary.