Skip to content

Neuron Registration #73

Neuron Registration

Neuron Registration #73

name: Typescript E2E Tests
on:
pull_request:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
typescript-formatting:
runs-on: ubuntu-latest
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ts-tests/.nvmrc
- name: Install system dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler pkg-config
- name: Install e2e dependencies
working-directory: ts-tests
run: pnpm install --frozen-lockfile
- name: Formatting check
run: |
cd ts-tests
pnpm run fmt
# Build the node binary in both variants and share as artifacts.
build:
runs-on: [self-hosted, type-ccx33]
needs: [typescript-formatting]
timeout-minutes: 60
strategy:
matrix:
include:
- variant: release
flags: ""
- variant: fast
flags: "--features fast-runtime"
env:
RUST_BACKTRACE: full
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends \
-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler pkg-config
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Utilize Shared Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: e2e-${{ matrix.variant }}
cache-on-failure: true
- name: Build node-subtensor (${{ matrix.variant }})
run: cargo build --profile release ${{ matrix.flags }} -p node-subtensor
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: node-subtensor-${{ matrix.variant }}
path: target/release/node-subtensor
if-no-files-found: error
run-e2e-tests:
needs: [build]
runs-on: [self-hosted, type-ccx33]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- test: dev
binary: release
- test: zombienet_shield
binary: release
- test: zombienet_staking
binary: fast
name: "typescript-e2e-${{ matrix.test }}"
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Download binary
uses: actions/download-artifact@v4
with:
name: node-subtensor-${{ matrix.binary }}
path: target/release
- name: Make binary executable
run: chmod +x target/release/node-subtensor
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ts-tests/.nvmrc
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install e2e dependencies
working-directory: ts-tests
run: pnpm install --frozen-lockfile
- name: Run tests
run: |
cd ts-tests
pnpm moonwall test ${{ matrix.test }}