File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Matrix Job Example for Modal GitHub Runner
2+ #
3+ # This workflow demonstrates how to run matrix jobs on Modal runners.
4+ #
5+ # IMPORTANT: Each matrix job needs a unique label to get its own runner.
6+ # Without unique labels, multiple matrix jobs compete for the same runner
7+ # and get stuck in "queued" state.
8+ #
9+ # The pattern: job-${{ github.run_id }}-${{ strategy.job-index }}
10+ # - github.run_id = unique per workflow run
11+ # - strategy.job-index = unique per matrix entry (0, 1, 2, ...)
12+ # Combined, they guarantee 1:1 binding between job and runner.
13+
14+ name : Matrix Example
15+
16+ on :
17+ workflow_dispatch :
18+
19+ jobs :
20+ test :
21+ runs-on :
22+ - self-hosted
23+ - modal
24+ - job-${{ github.run_id }}-${{ strategy.job-index }}
25+ timeout-minutes : 15
26+
27+ strategy :
28+ matrix :
29+ python-version : ["3.10", "3.11", "3.12"]
30+
31+ steps :
32+ - uses : actions/checkout@v4
33+
34+ - name : Set up Python ${{ matrix.python-version }}
35+ run : |
36+ python${{ matrix.python-version }} --version || true
37+ echo "Testing with Python ${{ matrix.python-version }}"
38+
39+ - name : Run tests
40+ run : |
41+ echo "Running tests on Python ${{ matrix.python-version }}"
42+ echo "Runner OS: $(uname -s)"
43+ echo "Runner arch: $(uname -m)"
You can’t perform that action at this time.
0 commit comments