60
60
name : subtensor-localnet
61
61
path : subtensor-localnet.tar
62
62
63
+ create_venv :
64
+ runs-on : ubuntu-latest
65
+ steps :
66
+ - name : Check out repository
67
+ uses : actions/checkout@v4
68
+
69
+ - name : Install Python
70
+ uses : actions/setup-python@v4
71
+
72
+ - name : Create Python virtual environment
73
+ run : python -m venv ${{ github.workspace }}/venv
74
+
75
+ - name : Install dependencies
76
+ run : |
77
+ ${{ github.workspace }}/venv/bin/pip install -e .[dev]
78
+ ${{ github.workspace }}/venv/bin/pip install pytest
79
+
80
+ - name : Upload virtual environment as artifact
81
+ uses : actions/upload-artifact@v4
82
+ with :
83
+ name : venv
84
+ path : ${{ github.workspace }}/venv
85
+
86
+
63
87
# Job to run tests in parallel
64
88
run :
65
89
needs :
@@ -69,15 +93,29 @@ jobs:
69
93
timeout-minutes : 45
70
94
strategy :
71
95
fail-fast : false # Allow other matrix jobs to run even if this job fails
72
- max-parallel : 8 # Set the maximum number of parallel jobs
96
+ max-parallel : 32 # Set the maximum number of parallel jobs (same as we have cores in SubtensorCI runner)
73
97
matrix :
74
98
os :
75
99
- ubuntu-latest
76
100
test-file : ${{ fromJson(needs.find-tests.outputs.test-files) }}
77
101
steps :
78
- - name : Check-out repository under $GITHUB_WORKSPACE
102
+ - name : Check-out repository
79
103
uses : actions/checkout@v4
80
104
105
+ - name : Download virtual environment
106
+ uses : actions/download-artifact@v4
107
+ with :
108
+ name : venv
109
+ path : venv
110
+
111
+ - name : Install Python
112
+ uses : actions/setup-python@v4
113
+
114
+ - name : Install requirements
115
+ run : |
116
+ ${{ github.workspace }}/venv/bin/pip install -e .[dev]
117
+ ${{ github.workspace }}/venv/bin/pip install pytest
118
+
81
119
# - name: Install uv
82
120
# uses: astral-sh/setup-uv@v4
83
121
#
94
132
95
133
- name : Run tests
96
134
run : |
97
- pip install -e .[dev]
98
- pip install pytest
99
- pytest ${{ matrix.test-file }} -s
135
+ ${{ github.workspace }}/venv/bin/pytest ${{ matrix.test-file }} -s
0 commit comments