Skip to content

Phase 3: Add multi-platform testing (Linux, macOS, Windows) #186

@RAprogramm

Description

@RAprogramm

Objective

Enable cross-platform testing on Linux, macOS, and Windows to ensure compatibility and catch platform-specific bugs early.

Implementation

1. Add OS Matrix to Test Job

Extend the existing matrix strategy to include multiple operating systems:

strategy:
  fail-fast: false
  matrix:
    rust:
      - ${{ needs.msrv.outputs.version }}
      - stable
    os:
      - ubuntu-latest
      - macos-latest
      - windows-latest

2. Platform-Specific Considerations

  • Path Separators: Ensure tests handle both / (Unix) and \ (Windows)
  • Line Endings: CRLF (Windows) vs LF (Unix/macOS)
  • File Permissions: Unix permissions don't apply on Windows
  • Case Sensitivity: Windows filesystem is case-insensitive
  • Symbolic Links: May require special handling on Windows

3. Conditional Steps

Add platform-specific steps if needed:

- name: Platform-specific setup (Windows)
  if: runner.os == 'Windows'
  run: # Windows-specific commands

- name: Platform-specific setup (macOS)
  if: runner.os == 'macOS'
  run: # macOS-specific commands

4. Cache Optimization

Adjust cache keys for multi-platform:

- name: Cache cargo
  uses: Swatinem/rust-cache@v2
  with:
    key: test-${{ matrix.rust }}-${{ matrix.os }}
    save-if: ${{ github.ref == 'refs/heads/main' }}

Benefits

  • Platform Compatibility: Catch OS-specific bugs before users do
  • Wider Audience: Confidence for users on all major platforms
  • Production Ready: Enterprise-grade cross-platform support
  • Early Detection: CI catches platform issues immediately

Test Plan

  • Matrix configuration validated
  • Tests pass on Ubuntu
  • Tests pass on macOS
  • Tests pass on Windows
  • Cache strategy optimized for multi-OS
  • No platform-specific test failures
  • CI runtime remains acceptable (<5 min total)

Acceptance Criteria

  • Test job runs on ubuntu-latest, macos-latest, windows-latest
  • All 157 tests pass on all platforms
  • Platform-specific edge cases handled
  • Cache keys include OS identifier
  • Workflow summary shows results per platform
  • No regression in CI performance

Parent: #175

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions