Skip to content

Add Windows and macOS to build matrix in GitHub Actions run, fix cross-platform issues - #1066

Open
addwes7 wants to merge 1 commit into
mrniko:masterfrom
addwes7:pr-branch
Open

Add Windows and macOS to build matrix in GitHub Actions run, fix cross-platform issues#1066
addwes7 wants to merge 1 commit into
mrniko:masterfrom
addwes7:pr-branch

Conversation

@addwes7

@addwes7 addwes7 commented May 20, 2026

Copy link
Copy Markdown

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 term 'export' is not recognized as a name of a cmdlet, function, script file, or executable program. 
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

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:

- name: Build
  run: export MAVEN_OPTS="-Dorg.slf4j..." mvn...

The export command is a bash built-in for setting environment variables. Windows GitHub Actions runners use PowerShell as the default shell, which does not recognize export. 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-level env: block:

env:
  MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN"

This sets the environment variable using GitHub Actions' native mechanism, which works identically on all three operating systems regardless of the shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant