Interview Prep/GitHub Actions/Contexts, Expressions, Env & Outputs

What are the `strategy` context values and when are they useful?

AdvancedConceptContexts, Expressions, Env & Outputs
Answer

strategy.job-index (0-based), strategy.job-total, strategy.fail-fast, strategy.max-parallel. Index and total enable test sharding without a matrix of shard numbers:

strategy:
  matrix:
    shard: [1, 2, 3, 4]
steps:
  - run: npx playwright test --shard=${{ matrix.shard }}/${{ strategy.job-total }}
All GitHub Actions questions Roadmap: GitHub Actions

More on Contexts, Expressions, Env & Outputs