Github Actions Strategy Matrix Examples

Provides examples on different ways to use strategy matrix in github actions

Strategy Matrix Walkthrough

Click To Watch ☝️ - The Matrix of Github Action

Matrix run Diagram

Workflow Examples

.github
└── workflows
    ├── sample-matrix-do-not-exit-early.yml
    ├── sample-matrix-exit-early.yml
    ├── sample-matrix-max-parallel.yml
    ├── sample-matrix-use-includes-json-syntax.yml
    ├── sample-matrix-use-includes-syntax.yml
    └── sample-matrix.yml
  • sample-matrix.yml

    • Shows simple matrix usage by providing fixed values

      Sample Matrix Parallel

  • sample-matrix-max-parallel

    • Shows how to add max number of parallel jobs in the matrix to allow running at the same time

      Sample Run Max 2 Jobs In Parallel

  • sample-matrix-exit-early

    • Shows how if one job fails within the matrix the whole matrix of jobs will fail

      Sample Should Fail All Runs

  • sample-matrix-do-not-exit-early

    • Shows how to let the strategy know not to exit the matrix if one of the jobs withing the matrix fails

      Sample Should Fail Run 1 Only

  • sample-matrix-use-include-syntax

    • Shows include syntax in yaml format

      Sample Run Include Syntax

  • sample-matrix-use-include-json-syntax

    • Shows include syntax in json format

      Sample Run Include Syntax Json Format