@@ -10,49 +10,25 @@ concurrency:
1010
1111on :
1212 pull_request :
13- branches :
14- - devnet
15- - devnet-ready
16- - testnet
17- - testnet-ready
18- - main
13+ branches : ["*"]
1914 types : [opened, synchronize, reopened, labeled, unlabeled]
2015
16+ workflow_dispatch :
17+ inputs :
18+ verbose :
19+ description : " Output more information when triggered manually"
20+ required : false
21+ default : " "
22+
2123env :
2224 CARGO_TERM_COLOR : always
2325 VERBOSE : ${{ github.event.inputs.verbose }}
2426
2527jobs :
26- apply-label-to-new-pr :
27- runs-on : ubuntu-latest
28- if : ${{ github.event.pull_request.draft == false }}
29- outputs :
30- should_continue : ${{ steps.check.outputs.should_continue }}
31- steps :
32- - name : Check
33- id : check
34- run : |
35- ACTION="${{ github.event.action }}"
36- if [[ "$ACTION" == "opened" || "$ACTION" == "reopened" ]]; then
37- echo "should_continue=true" >> $GITHUB_OUTPUT
38- else
39- echo "should_continue=false" >> $GITHUB_OUTPUT
40- fi
41- shell : bash
42-
43- - name : Add label
44- if : steps.check.outputs.should_continue == 'true'
45- uses : actions-ecosystem/action-add-labels@v1
46- with :
47- github_token : ${{ secrets.GITHUB_TOKEN }}
48- labels : run-bittensor-e2e-tests
49-
5028 check-label :
51- needs : apply-label-to-new-pr
5229 runs-on : ubuntu-latest
53- if : always()
5430 outputs :
55- run -bittensor-e2e-tests : ${{ steps.get-labels.outputs.run -bittensor-e2e-tests }}
31+ skip -bittensor-e2e-tests : ${{ steps.get-labels.outputs.skip -bittensor-e2e-tests }}
5632 steps :
5733 - name : Check out repository
5834 uses : actions/checkout@v4
@@ -62,19 +38,17 @@ jobs:
6238 run : |
6339 LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
6440 echo "Current labels: $LABELS"
65- if echo "$LABELS" | grep -q "run-bittensor-e2e-tests"; then
66- echo "run-bittensor-e2e-tests=true" >> $GITHUB_ENV
67- echo "::set-output name=run-bittensor-e2e-tests::true"
41+ if echo "$LABELS" | grep -q "skip-bittensor-e2e-tests"; then
42+ echo "skip-bittensor-e2e-tests=true" >> $GITHUB_OUTPUT
6843 else
69- echo "run-bittensor-e2e-tests=false" >> $GITHUB_ENV
70- echo "::set-output name=run-bittensor-e2e-tests::false"
44+ echo "skip-bittensor-e2e-tests=false" >> $GITHUB_OUTPUT
7145 fi
7246 env :
7347 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7448
7549 find-btcli-e2e-tests :
7650 needs : check-label
77- if : always() && needs.check-label.outputs.run -bittensor-e2e-tests == 'true '
51+ if : needs.check-label.outputs.skip -bittensor-e2e-tests == 'false '
7852 runs-on : ubuntu-latest
7953 outputs :
8054 test-files : ${{ steps.get-btcli-tests.outputs.test-files }}
@@ -94,12 +68,12 @@ jobs:
9468 id : get-btcli-tests
9569 run : |
9670 test_files=$(find ${{ github.workspace }}/btcli/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
97- echo "::set-output name= test-files:: $test_files"
71+ echo "test-files= $test_files" >> $GITHUB_OUTPUT
9872 shell : bash
9973
10074 find-sdk-e2e-tests :
10175 needs : check-label
102- if : always() && needs.check-label.outputs.run -bittensor-e2e-tests == 'true '
76+ if : needs.check-label.outputs.skip -bittensor-e2e-tests == 'false '
10377 runs-on : ubuntu-latest
10478 outputs :
10579 test-files : ${{ steps.get-sdk-tests.outputs.test-files }}
11993 id : get-sdk-tests
12094 run : |
12195 test_files=$(find ${{ github.workspace }}/bittensor/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
122- echo "::set-output name= test-files:: $test_files"
96+ echo "test-files= $test_files" >> $GITHUB_OUTPUT
12397 shell : bash
12498
12599 build-image-with-current-branch :
@@ -128,6 +102,13 @@ jobs:
128102 steps :
129103 - name : Checkout code
130104 uses : actions/checkout@v4
105+ with :
106+ ref : ${{ github.head_ref }}
107+
108+ - name : Patch non-fast-block node
109+ run : |
110+ chmod +x ./scripts/localnet_patch.sh
111+ ./scripts/localnet_patch.sh
131112
132113 - name : Set up QEMU
133114 uses : docker/setup-qemu-action@v3
@@ -153,7 +134,7 @@ jobs:
153134 - check-label
154135 - find-btcli-e2e-tests
155136 - build-image-with-current-branch
156- if : always() && needs.check-label.outputs.run -bittensor-e2e-tests == 'true '
137+ if : needs.check-label.outputs.skip -bittensor-e2e-tests == 'false '
157138 runs-on : ubuntu-latest
158139 strategy :
159140 fail-fast : false
@@ -182,6 +163,8 @@ jobs:
182163
183164 - name : Install uv
184165 uses : astral-sh/setup-uv@v5
166+ with :
167+ enable-cache : ' false'
185168
186169 - name : Create Python virtual environment
187170 working-directory : ${{ github.workspace }}
@@ -201,10 +184,6 @@ jobs:
201184 uv run --active pip install '.[dev]'
202185 uv run --active pip install pytest
203186
204- - name : Install uv dependencies
205- working-directory : ${{ github.workspace }}/btcli
206- run : uv sync --all-extras --dev
207-
208187 - name : Download Cached Docker Image
209188 uses : actions/download-artifact@v4
210189 with :
@@ -213,6 +192,9 @@ jobs:
213192 - name : Load Docker Image
214193 run : docker load -i subtensor-localnet.tar
215194
195+ - name : Retag Docker Image
196+ run : docker tag localnet ghcr.io/opentensor/subtensor-localnet:devnet-ready
197+
216198# - name: Run tests
217199# working-directory: ${{ github.workspace }}/btcli
218200# run: |
@@ -223,6 +205,7 @@ jobs:
223205 working-directory : ${{ github.workspace }}/btcli
224206 run : |
225207 source ${{ github.workspace }}/venv/bin/activate
208+ export SKIP_PULL=1
226209 set +e
227210 for i in 1 2; do
228211 echo "🔁 Attempt $i: Running tests"
@@ -248,7 +231,7 @@ jobs:
248231 - check-label
249232 - find-sdk-e2e-tests
250233 - build-image-with-current-branch
251- if : always() && needs.check-label.outputs.run -bittensor-e2e-tests == 'true '
234+ if : needs.check-label.outputs.skip -bittensor-e2e-tests == 'false '
252235 runs-on : ubuntu-latest
253236 strategy :
254237 fail-fast : false
@@ -277,6 +260,8 @@ jobs:
277260
278261 - name : Install uv
279262 uses : astral-sh/setup-uv@v5
263+ with :
264+ enable-cache : ' false'
280265
281266 - name : Create Python virtual environment
282267 working-directory : ${{ github.workspace }}
@@ -296,10 +281,6 @@ jobs:
296281 uv run --active pip install '.[dev]'
297282 uv run --active pip install pytest
298283
299- - name : Install uv dependencies
300- working-directory : ${{ github.workspace }}/bittensor
301- run : uv sync --all-extras --dev
302-
303284 - name : Download Cached Docker Image
304285 uses : actions/download-artifact@v4
305286 with :
@@ -308,6 +289,9 @@ jobs:
308289 - name : Load Docker Image
309290 run : docker load -i subtensor-localnet.tar
310291
292+ - name : Retag Docker Image
293+ run : docker tag localnet ghcr.io/opentensor/subtensor-localnet:devnet-ready
294+
311295# - name: Run tests
312296# working-directory: ${{ github.workspace }}/bittensor
313297# run: |
@@ -318,6 +302,7 @@ jobs:
318302 working-directory : ${{ github.workspace }}/bittensor
319303 run : |
320304 source ${{ github.workspace }}/venv/bin/activate
305+ export SKIP_PULL=1
321306 set +e
322307 for i in 1 2; do
323308 echo "🔁 Attempt $i: Running tests"
@@ -335,4 +320,4 @@ jobs:
335320 echo "🕒 Retrying..."
336321 sleep 5
337322 fi
338- done
323+ done
0 commit comments