Validate portability across Linux, macOS, and Windows.

Section: Matrix, reuse, and services

Run on multiple operating systems

yaml
yaml
strategy:
  matrix:
    os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
Explanation

Great for CLI tools and cross-platform libraries.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Matrix, reuse, and services
Test across multiple Node versions
Use a strategy matrix for version coverage.
OpenIn sheetyamlsame section
Start a PostgreSQL service container
Run integration tests against a database service.
OpenIn sheetyamlsame section
Call a reusable workflow
Centralize shared CI logic in one workflow file.
OpenIn sheetyamlsame section
Composite action metadata
Bundle repeated shell steps into a reusable local action.
OpenIn sheetyamlsame section
Check out repository code
Fetch the repo in a workflow job.
Set up Node.js
Install a specific Node.js version for the job.