name: Generate strategy matrix on: workflow_call: inputs: os: description: 'The operating system to use for the build ("linux", "macos", "windows", or empty for all).' required: false type: string outputs: matrix: description: "The generated strategy matrix." value: ${{ jobs.generate-matrix.outputs.matrix }} defaults: run: shell: bash jobs: generate-matrix: runs-on: ubuntu-latest outputs: matrix: ${{ steps.generate.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.13" - name: Generate strategy matrix working-directory: .github/scripts/strategy-matrix id: generate env: GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}', inputs.os) || '' }} # Run only the minimal matrix for pull requests that are not yet # labeled "Ready to merge" or "Full CI build". Any other event (merge # queue, push, schedule, manual dispatch) runs the full matrix. GENERATE_MINIMAL: ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'Ready to merge') && !contains(github.event.pull_request.labels.*.name, 'Full CI build')) && '--minimal' || '' }} run: ./generate.py ${GENERATE_CONFIG} ${GENERATE_MINIMAL} >>"${GITHUB_OUTPUT}"