@@ -61,10 +61,10 @@ jobs:
6161 echo "Current labels: $LABELS"
6262 if echo "$LABELS" | grep -q "run-bittensor-cli-tests"; then
6363 echo "run-cli-tests=true" >> $GITHUB_ENV
64- echo "::set-output name= run-cli-tests:: true"
64+ echo "run-cli-tests= true" >> $GITHUB_OUTPUT
6565 else
6666 echo "run-cli-tests=false" >> $GITHUB_ENV
67- echo "::set-output name= run-cli-tests:: false"
67+ echo "run-cli-tests= false" >> $GITHUB_OUTPUT
6868 fi
6969 env :
7070 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9191 id : get-tests
9292 run : |
9393 test_files=$(find ${{ github.workspace }}/btcli/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
94- echo "::set-output name= test-files:: $test_files"
94+ echo "test-files= $test_files" >> $GITHUB_OUTPUT
9595 shell : bash
9696
9797 pull-docker-image :
@@ -147,45 +147,47 @@ jobs:
147147 - name : Check-out repository
148148 uses : actions/checkout@v4
149149
150- - name : Install dependencies
150+ - name : Install system dependencies
151151 run : |
152152 sudo apt-get update &&
153153 sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
154154
155- - name : Create Python virtual environment
156- working-directory : ${{ github.workspace }}
157- run : python3 -m venv ${{ github.workspace }}/venv
155+ - name : Set up Python
156+ uses : actions/setup-python@v5
157+ with :
158+ python-version : ' 3.13'
159+
160+ - name : Install uv
161+ uses : astral-sh/setup-uv@v4
158162
159163 - name : Clone Bittensor CLI repo
160- working-directory : ${{ github.workspace }}
161164 run : git clone https://github.com/opentensor/btcli.git
162165
163- - name : Setup Bittensor-cli from cloned repo
166+ - name : Checkout btcli staging branch
164167 working-directory : ${{ github.workspace }}/btcli
165168 run : |
166- source ${{ github.workspace }}/venv/bin/activate
167169 git checkout staging
168170 git fetch origin staging
169- python3 -m pip install --upgrade pip uv
170- uv pip install '.[dev]'
171- uv pip install pytest
171+
172+ - name : Install btcli dependencies
173+ working-directory : ${{ github.workspace }}/btcli
174+ run : uv pip install --system '.[dev]'
172175
173176 - name : Clone async-substrate-interface repo
174177 run : git clone https://github.com/opentensor/async-substrate-interface.git
175178
176- - name : Checkout PR async-substrate-interface repo
179+ - name : Checkout PR branch in async-substrate-interface
177180 working-directory : ${{ github.workspace }}/async-substrate-interface
178181 run : |
179182 git fetch origin ${{ github.event.pull_request.head.ref }}
180183 git checkout ${{ github.event.pull_request.head.ref }}
181184 echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
182185
183- - name : Install async-substrate-interface package
186+ - name : Install async-substrate-interface with dev dependencies
184187 working-directory : ${{ github.workspace }}/async-substrate-interface
185188 run : |
186- source ${{ github.workspace }}/venv/bin/activate
187- python3 -m pip uninstall async-substrate-interface -y
188- uv pip install .
189+ uv pip uninstall --system async-substrate-interface || true
190+ uv pip install --system '.[dev]'
189191
190192 - name : Download Cached Docker Image
191193 uses : actions/download-artifact@v4
@@ -195,10 +197,8 @@ jobs:
195197 - name : Load Docker Image
196198 run : docker load -i subtensor-localnet.tar
197199
198- - name : Run tests
199- run : |
200- source ${{ github.workspace }}/venv/bin/activate
201- pytest ${{ matrix.test-file }} -s
200+ - name : Run e2e tests
201+ run : pytest ${{ matrix.test-file }} -s
202202
203203
204204 run-unit-test :
@@ -210,46 +210,47 @@ jobs:
210210 - name : Check-out repository
211211 uses : actions/checkout@v4
212212
213- - name : Install dependencies
213+ - name : Install system dependencies
214214 run : |
215215 sudo apt-get update &&
216216 sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
217217
218- - name : Create Python virtual environment
219- working-directory : ${{ github.workspace }}
220- run : python3 -m venv venv
218+ - name : Set up Python
219+ uses : actions/setup-python@v5
220+ with :
221+ python-version : ' 3.13'
222+
223+ - name : Install uv
224+ uses : astral-sh/setup-uv@v4
221225
222226 - name : Clone Bittensor CLI repo
223- working-directory : ${{ github.workspace }}
224227 run : git clone https://github.com/opentensor/btcli.git
225228
226- - name : Setup Bittensor SDK from cloned repo
229+ - name : Checkout btcli staging branch
227230 working-directory : ${{ github.workspace }}/btcli
228231 run : |
229- source ${{ github.workspace }}/venv/bin/activate
230232 git checkout staging
231233 git fetch origin staging
232- python3 -m pip install --upgrade pip uv
233- uv pip install '.[dev]'
234+
235+ - name : Install btcli dependencies
236+ working-directory : ${{ github.workspace }}/btcli
237+ run : uv pip install --system '.[dev]'
234238
235239 - name : Clone async-substrate-interface repo
236240 run : git clone https://github.com/opentensor/async-substrate-interface.git
237241
238- - name : Checkout PR branch in async-substrate-interface repo
242+ - name : Checkout PR branch in async-substrate-interface
239243 working-directory : ${{ github.workspace }}/async-substrate-interface
240244 run : |
241245 git fetch origin ${{ github.event.pull_request.head.ref }}
242246 git checkout ${{ github.event.pull_request.head.ref }}
243247 echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
244248
245- - name : Install / async-substrate-interface package
249+ - name : Install async-substrate-interface with dev dependencies
246250 working-directory : ${{ github.workspace }}/async-substrate-interface
247251 run : |
248- source ${{ github.workspace }}/venv/bin/activate
249- pip uninstall async-substrate-interface -y
250- uv pip install .
252+ uv pip uninstall --system async-substrate-interface || true
253+ uv pip install --system '.[dev]'
251254
252- - name : Run SDK unit tests
253- run : |
254- source ${{ github.workspace }}/venv/bin/activate
255- pytest ${{ github.workspace }}/btcli/tests/unit_tests
255+ - name : Run BTCLI unit tests
256+ run : pytest ${{ github.workspace }}/btcli/tests/unit_tests
0 commit comments