CICD-037 · Matrix across operating systems
Encyclopedia · Matrices and sharding · All snippets
Previous · CICD-036 · Next · CICD-038
1. Where it fits
- Placement .github/workflows/ci.yml, inside the relevant job.
- Prerequisites workspace whose runtime dependencies match the chosen target combinations.
- Platforms github-actions, gitea-actions.
2. Copy the snippet
yaml
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}3. How it works
runs-on is evaluated separately for each OS entry. Commands still need compatible shells and project behavior on every operating system selected.
4. Verify the result
Use portable shell commands or explicit per-OS steps.
Validation syntax-validated (YAML parse). Status definitions.