Skip to content

Commit 1538152

Browse files
update e2e tests workflow
1 parent bb2d795 commit 1538152

File tree

1 file changed

+33
-81
lines changed

1 file changed

+33
-81
lines changed

.github/workflows/e2e-subtensor-tests.yaml

+33-81
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,6 @@ env:
2626
# job to run tests in parallel
2727
jobs:
2828

29-
get-latest-artifact-id:
30-
runs-on: ubuntu-latest
31-
32-
steps:
33-
- name: Fetch Artifacts List
34-
id: fetch_artifacts
35-
run: |
36-
ARTIFACTS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/opentensor/subtensor/actions/artifacts)
37-
echo "$ARTIFACTS" > artifacts.json
38-
39-
echo "Raw ARTIFACTS response:"
40-
echo "$ARTIFACTS"
41-
42-
- name: Parse Latest Artifact ID
43-
id: parse_artifact
44-
run: |
45-
LATEST_ARTIFACT_ID=$(jq -r '.artifacts[0].id' artifacts.json)
46-
echo "LATEST_ARTIFACT_ID=$LATEST_ARTIFACT_ID" >> $GITHUB_ENV
47-
48-
- name: Print Latest Artifact ID
49-
run: |
50-
echo "Latest Artifact ID: ${{ env.LATEST_ARTIFACT_ID }}"
51-
52-
# Job to find all test files
5329
find-tests:
5430
runs-on: ubuntu-latest
5531
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
@@ -66,81 +42,57 @@ jobs:
6642
echo "::set-output name=test-files::$test_files"
6743
shell: bash
6844

45+
pull-docker-image:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Log in to GitHub Container Registry (если образ приватный)
49+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
50+
51+
- name: Pull Docker Image
52+
run: docker pull ghcr.io/opentensor/subtensor-localnet:latest
53+
54+
- name: Save Docker Image to Cache
55+
run: docker save -o subtensor-localnet.tar ghcr.io/opentensor/subtensor-localnet:latest
56+
57+
- name: Upload Docker Image as Artifact
58+
uses: actions/upload-artifact@v3
59+
with:
60+
name: subtensor-localnet
61+
path: subtensor-localnet.tar
62+
retention-days: 1
63+
6964
# Job to run tests in parallel
7065
run:
71-
needs: find-tests
66+
needs:
67+
- find-tests
68+
- pull-docker-image
7269
runs-on: ubuntu-latest
7370
timeout-minutes: 45
7471
strategy:
7572
fail-fast: false # Allow other matrix jobs to run even if this job fails
7673
max-parallel: 8 # Set the maximum number of parallel jobs
7774
matrix:
78-
rust-branch:
79-
- stable
80-
rust-target:
81-
- x86_64-unknown-linux-gnu
8275
os:
8376
- ubuntu-latest
8477
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
85-
env:
86-
RELEASE_NAME: development
87-
RUSTV: ${{ matrix.rust-branch }}
88-
RUST_BACKTRACE: full
89-
RUST_BIN_DIR: target/${{ matrix.rust-target }}
90-
TARGET: ${{ matrix.rust-target }}
9178
steps:
9279
- name: Check-out repository under $GITHUB_WORKSPACE
9380
uses: actions/checkout@v4
9481

95-
- name: Install dependencies
96-
run: |
97-
sudo apt-get update &&
98-
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
82+
# - name: Install uv
83+
# uses: astral-sh/setup-uv@v4
84+
#
85+
# - name: install dependencies
86+
# run: uv sync --all-extras --dev
9987

100-
- name: Install Rust ${{ matrix.rust-branch }}
101-
uses: actions-rs/toolchain@v1.0.6
88+
- name: Download Cached Docker Image
89+
uses: actions/download-artifact@v4
10290
with:
103-
toolchain: ${{ matrix.rust-branch }}
104-
components: rustfmt
105-
profile: minimal
106-
107-
- name: Add wasm32-unknown-unknown target
108-
run: |
109-
rustup target add wasm32-unknown-unknown --toolchain stable-x86_64-unknown-linux-gnu
110-
rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
111-
112-
- name: Clone subtensor repo
113-
run: git clone https://github.com/opentensor/subtensor.git
91+
name: subtensor-localnet
11492

115-
- name: Setup subtensor repo
116-
working-directory: ${{ github.workspace }}/subtensor
117-
run: git checkout devnet-ready-with-nodes
118-
119-
- name: Print files and OS info
120-
working-directory: ${{ github.workspace }}/subtensor
121-
run: |
122-
sudo apt install file
123-
echo "File fast-blocks"
124-
file ${{ github.workspace }}/subtensor/nodes/fast-blocks/release/node-subtensor
125-
echo "File non-fast-blocks"
126-
file ${{ github.workspace }}/subtensor/nodes/non-fast-blocks/release/node-subtensor
127-
128-
echo "uname -m && uname -r"
129-
uname -m && uname -r
130-
131-
- name: Install uv
132-
uses: astral-sh/setup-uv@v4
133-
134-
- name: install dependencies
135-
run: uv sync --all-extras --dev
93+
- name: Load Docker Image
94+
run: docker load -i subtensor-localnet.tar
13695

13796
- name: Run tests
13897
run: |
139-
ls -lash ${{ github.workspace }}/subtensor/nodes
140-
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" uv run pytest ${{ matrix.test-file }} -s
141-
142-
- name: Retry failed tests
143-
if: failure()
144-
run: |
145-
sleep 10
146-
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" uv run pytest ${{ matrix.test-file }} -s
98+
pytest ${{ matrix.test-file }} -s

0 commit comments

Comments
 (0)