Add Windows and macOS to build matrix in GitHub Actions run, fix cross-platform issues - #1066
Open
addwes7 wants to merge 1 commit into
Open
Add Windows and macOS to build matrix in GitHub Actions run, fix cross-platform issues#1066addwes7 wants to merge 1 commit into
addwes7 wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the purpose of this PR
This PR adds Windows and macOS to the CI build matrix. The existing workflow only runs on Ubuntu. When expanding to other operating systems, the build fails on Windows due to a bash-specific export command in the workflow file. macOS passes without any code changes.
Expected result
The build should pass on Ubuntu, Windows, and macOS without any failures.
Actual results
The build fails on Windows with the following error:
The macOS build passes without issues. Ubuntu continues to pass as before.
Why the build fails when run on Windows
The workflow file contains the following step:
The
exportcommand is a bash built-in for setting environment variables. Windows GitHub Actions runners use PowerShell as the default shell, which does not recognizeexport. macOS runners default to bash, so the same command works on macOS without issues.Fix
Replaced the inline
export MAVEN_OPTS="-Dorg.slf4j..."shell command with a job-levelenv:block:This sets the environment variable using GitHub Actions' native mechanism, which works identically on all three operating systems regardless of the shell.