Skip to content

Run CI on macOS and Windows#1187

Merged
sferik merged 1 commit into
mainfrom
add-mac-windows-ci
May 20, 2026
Merged

Run CI on macOS and Windows#1187
sferik merged 1 commit into
mainfrom
add-mac-windows-ci

Conversation

@sferik
Copy link
Copy Markdown
Collaborator

@sferik sferik commented May 20, 2026

Our CI matrix only exercised Ubuntu, so platform-specific bugs (Windows lacking fork, path-separator assumptions, macOS-specific filesystem behavior) only ever surfaced once they hit a user. This adds macOS and Windows jobs to both stable.yml and unstable.yml.

To keep the job count modest, each new OS gets a single MRI entry via matrix.include rather than fanning out across every Ruby version:

  • stable.yml: 8 Ubuntu jobs (unchanged) + 1 macOS on Ruby 3.4 + 1 Windows on Ruby 3.4
  • unstable.yml: 3 Ubuntu jobs (unchanged) + 1 macOS on ruby-head + 1 Windows on ruby-head

The macOS jobs run the full rake test. Windows runs rake spec only, since the cucumber suite drives headless Chrome via cuprite/ferrum and the same flakiness that already excludes JRuby and TruffleRuby applies on Windows runners. The existing skip condition is extended to cover matrix.os == 'windows-latest'.

rm Gemfile.lock is pinned to shell: bash so the step is unambiguous on Windows (where the default shell is PowerShell and rm is an alias for Remove-Item).

Resolves #940.

@sferik sferik force-pushed the add-mac-windows-ci branch 8 times, most recently from 4f29f04 to ca7a9a6 Compare May 20, 2026 15:09
Adds a single MRI job per new OS via `matrix.include`: macOS and Windows on the latest stable Ruby (`ruby-version: ruby`), with `ruby-head` for the equivalent slots in unstable.yml. macOS runs the full `rake test`; Windows runs `rake spec` only, since the cucumber suite drives headless Chrome via cuprite/ferrum, the same reason JRuby and TruffleRuby already skip it. `rm Gemfile.lock` is pinned to `shell: bash` so the step is unambiguous under PowerShell. `timeout-minutes: 20` on both workflows ensures a stuck spec fails fast instead of burning runner-hours against GitHub's 6-hour default.

Several test-suite portability fixes accompany the new jobs. `.gitattributes` forces LF line endings so Windows checkouts don't introduce CRLF into fixture-comparison specs (`source_file_spec` line/encoding examples). `return_codes_spec` passes env vars via the `Open3.capture3` env-hash form — the POSIX `VAR=value cmd` prefix syntax doesn't work outside a Unix shell. The `filters_spec` helper now uses `File.absolute_path?` instead of `path.start_with?("/")`, which misclassified `D:/...` paths on Windows.

Two specs whose subject is Unix-only are skipped on Windows: the `ResultMerger` "blocks other processes" example (shells out via `IO.popen("ruby -e ... 2>/dev/null")`, a POSIX redirection cmd.exe can't parse — the parent would spin forever on `gets`), and the `UselessResultsRemover` example exercising `SimpleCov.root("/")`, since `/` isn't a meaningful filesystem root on Windows.

Resolves #940
@sferik sferik force-pushed the add-mac-windows-ci branch from ca7a9a6 to 2d3a6ea Compare May 20, 2026 18:16
@sferik sferik merged commit 4933acd into main May 20, 2026
24 checks passed
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.

Add Windows (+ Mac) to CI

1 participant