Run CI on macOS and Windows#1187
Merged
Merged
Conversation
4f29f04 to
ca7a9a6
Compare
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
ca7a9a6 to
2d3a6ea
Compare
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.
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 bothstable.ymlandunstable.yml.To keep the job count modest, each new OS gets a single MRI entry via
matrix.includerather than fanning out across every Ruby version:ruby-head+ 1 Windows onruby-headThe macOS jobs run the full
rake test. Windows runsrake speconly, 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 covermatrix.os == 'windows-latest'.rm Gemfile.lockis pinned toshell: bashso the step is unambiguous on Windows (where the default shell is PowerShell andrmis an alias forRemove-Item).Resolves #940.