Skip to content

Commit 28f6bc5

Browse files
committed
using cached nodes
1 parent 3d161ca commit 28f6bc5

File tree

1 file changed

+60
-2
lines changed

1 file changed

+60
-2
lines changed

.github/workflows/check-sdk-tests.yml

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,66 @@ jobs:
4949
echo "::set-output name=test-files::$test_files"
5050
shell: bash
5151

52-
run-tests:
52+
print-tests:
5353
needs:
5454
- find-e2e-tests
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Print tests
58+
run: |
59+
test_files=$(echo '${{ needs.find-e2e-tests.outputs.test-files }}' | jq -r '.[]')
60+
for test_file in $test_files; do
61+
echo "$test_file"
62+
done
63+
shell: bash
64+
65+
cache-nodes:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Check out repository
69+
uses: actions/checkout@v4
70+
71+
- name: Clone Subtensor repo
72+
working-directory: ${{ github.workspace }}
73+
run: git clone https://github.com/opentensor/subtensor.git
74+
75+
- name: Checkout Subtensor repo to `devnet-ready` branch
76+
working-directory: ${{ github.workspace }}/subtensor
77+
run: git checkout devnet-ready
78+
79+
- name: Install dependencies
80+
run: |
81+
sudo apt-get update &&
82+
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler jq
83+
84+
- name: Add wasm32-unknown-unknown target
85+
run: |
86+
rustup target add wasm32-unknown-unknown --toolchain stable-x86_64-unknown-linux-gnu
87+
rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
88+
89+
- name: Build Subtensor nodes
90+
run: |
91+
echo "Bilding fast block nodes"
92+
${{ github.workspace }}/subtensor/scripts/localnet.sh --build-only
93+
echo "Bilding non-fast block nodes"
94+
${{ github.workspace }}/subtensor/scripts/localnet.sh False --build-only
95+
96+
- name: Save cache
97+
uses: actions/cache@v3
98+
with:
99+
path: ${{ github.workspace }}/subtensor/target/
100+
key: ${{ runner.os }}-subtensor-node
101+
102+
run-tests:
103+
needs:
55104
- check-labels
105+
- find-e2e-tests
106+
- cache-nodes
56107
runs-on: ubuntu-latest
57108
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false && needs.check-labels.outputs.run-sdk-tests == 'true' }}
58109
strategy:
59110
fail-fast: false
60-
max-parallel: 8
111+
max-parallel: 10
61112
matrix:
62113
rust-branch:
63114
- stable
@@ -130,6 +181,13 @@ jobs:
130181
working-directory: ${{ github.workspace }}/subtensor
131182
run: git checkout devnet-ready
132183

184+
- name: Restore cache
185+
uses: actions/cache@v3
186+
id: cache
187+
with:
188+
path: ${{ github.workspace }}/subtensor/target/
189+
key: ${{ runner.os }}-subtensor-node
190+
133191
- name: Run Bittensor SDK e2e test
134192
run: |
135193
source ${{ github.workspace }}/venv/bin/activate

0 commit comments

Comments
 (0)