Skip to content
Merged
Changes from 18 commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
2e081fc
Add `pr-checks.yaml` (sdk label only)
Feb 26, 2025
dbfe1b6
fix yaml
Feb 26, 2025
5e43c03
fix yaml
Feb 26, 2025
b543129
fix yaml
Feb 26, 2025
61d7caf
fix yaml
Feb 26, 2025
19dbda8
simple yaml
Feb 26, 2025
f573941
fix runner name
Feb 26, 2025
d60546e
fix .venv path
Feb 26, 2025
57aa218
fix LOCALNET_SH_PATH
Feb 26, 2025
bb91e05
fixes
Feb 26, 2025
2178d3c
fixes
Feb 26, 2025
572f18c
add install rust
Feb 26, 2025
d3c9ef6
add install rust + add cancellation in progress
Feb 26, 2025
a53c5e4
install and run into global python env
Feb 26, 2025
8e4a8ba
fix
Feb 26, 2025
2d1325d
bring back venv
Feb 26, 2025
babb882
remove debug
Feb 26, 2025
ec4a79f
split e2e tests
Feb 26, 2025
421e6db
use matrix
Feb 27, 2025
4b01c0b
add step
Feb 27, 2025
1688c2f
add steps
Feb 27, 2025
67e4de2
fix path
Feb 27, 2025
7878635
run e2e tests separately
Feb 27, 2025
3294de5
run e2e tests separately
Feb 27, 2025
31d92b3
update Find e2e test files step
Feb 27, 2025
9a15bff
keep find-e2e-tests as independent entity
Feb 27, 2025
8d882fd
add working-directory
Feb 27, 2025
a64a280
move step from one job into another one
Feb 27, 2025
9f3dc9e
move venv
Feb 27, 2025
c89f595
add needs to keep the order
Feb 27, 2025
de5c844
move
Feb 27, 2025
2b45510
add debug
Feb 27, 2025
b1b2cb7
remove step
Feb 27, 2025
affee33
concatenate jobs
Feb 27, 2025
4afbded
move e2e run to one job to avoid to use artifacts
Feb 27, 2025
2fa8366
use `TEST_FILES`
Feb 27, 2025
a34e5db
fix matrix regarding env (gh doesn't support it yet)
Feb 27, 2025
feda3bc
use artifact
Feb 27, 2025
3a758b5
fix
Feb 27, 2025
4fc02fd
fix typo
Feb 27, 2025
2cae121
try
Feb 27, 2025
6bca689
Merge branch 'staging' into feat/roman/add-pr-merge-checkers
Feb 27, 2025
5146672
improve
Feb 27, 2025
730bc94
add debug
Feb 27, 2025
9147f42
fix tests dir
Feb 27, 2025
185c022
another way
Feb 28, 2025
6960f22
fix step
Feb 28, 2025
00cfa6d
fix path
Feb 28, 2025
b44fdfe
fix path
Feb 28, 2025
ee57e56
try env
Feb 28, 2025
f877359
get-tests
Feb 28, 2025
d3d80db
debug
Feb 28, 2025
e105181
move if
Feb 28, 2025
cc61998
fix
Feb 28, 2025
bb5d163
fix path
Feb 28, 2025
02d3063
fix path
Feb 28, 2025
8983875
debug
Feb 28, 2025
8e74f8f
matrix
Feb 28, 2025
d7067af
remove commented
Feb 28, 2025
15cee77
remove debug
Feb 28, 2025
3f1f2bc
sdk checker
Feb 28, 2025
6e3bad6
add debug
Feb 28, 2025
2f25a6b
add debug with git ls-tree
Feb 28, 2025
533a68d
fix
Feb 28, 2025
ae98264
add dependencies step in find-e2e-tests job
Feb 28, 2025
a72a4e6
add missed venv
Feb 28, 2025
f8ac065
fix subtensor path
Feb 28, 2025
f613ad0
add pre-compiling
Feb 28, 2025
3d161ca
remove pre-compiling
Feb 28, 2025
28f6bc5
using cached nodes
Mar 11, 2025
d6c4df1
add debug
Mar 11, 2025
59ce2b8
add uv
Mar 12, 2025
d6f2948
add integration and unit tests
Mar 12, 2025
e9a5558
move if statement
Mar 12, 2025
45e5943
add if statement to all jobs
Mar 12, 2025
a5f3053
add auto apply labels
Mar 12, 2025
c82d021
fix
Mar 12, 2025
66d3484
fix
Mar 12, 2025
383d696
fix add labels
Mar 12, 2025
376794d
use `actions/labeler@v4`
Mar 12, 2025
7fe242c
use `actions/labeler@v4`
Mar 12, 2025
8501f16
add `skip-cargo-audit`
Mar 12, 2025
289c91e
just ping
Mar 12, 2025
8921ccd
update Auto Label PRs
Mar 12, 2025
60f4096
move unit/integration tests to separate job
Mar 12, 2025
2b8a85a
delete labeler.yml
Mar 12, 2025
e73a1ae
remove action
Mar 12, 2025
91f3f2a
add torch for integration tests
Mar 12, 2025
7593289
tests
Mar 12, 2025
4649429
uncomment needs and if
Mar 12, 2025
719e2f7
use short name for e2e test job
Mar 12, 2025
661f327
use short name for e2e test job
Mar 12, 2025
b18ec24
use entire name
Mar 12, 2025
c91e636
check time without cache nodes
Mar 12, 2025
77f393f
10 - 8
Mar 12, 2025
9647705
move run-integration-and-unit-test as last job
Mar 12, 2025
8bb8995
test with BUILD_BINARY=0
Mar 12, 2025
182e579
use docker + uv to speed up
Mar 17, 2025
61cefde
fix
Mar 17, 2025
212b41f
move install deps before maturin develop (avoid overwriting btwallet …
Mar 17, 2025
53c2f12
Merge branch 'staging' into feat/roman/add-pr-merge-checkers
basfroman Mar 18, 2025
0b04be4
add auto adding labels for opened, reopened, ready_for_review PR base…
Mar 18, 2025
babf897
add permissions
Mar 18, 2025
6b60266
syntax
Mar 18, 2025
9d6dad2
order
Mar 18, 2025
d667301
change if logic
Mar 18, 2025
a17aed4
add needs to pull-docker-image
Mar 18, 2025
cd7d4e7
add needs to pull-docker-image
Mar 18, 2025
cfdb981
fix
Mar 18, 2025
eade211
rename
Mar 18, 2025
c5c898b
add types
Mar 18, 2025
0e26935
remove types
Mar 18, 2025
067c1c6
remove workflow_run
Mar 18, 2025
0faf7ba
add btcli tests
Mar 18, 2025
c6a92b3
max-parallel has been divided by 2
Mar 18, 2025
9cd78e5
move logic into workflows
Mar 18, 2025
1da7b1c
fix
Mar 18, 2025
416373d
add permissions
Mar 18, 2025
432b351
fix labels
Mar 18, 2025
10a3cc5
reduce max-parallel
Mar 18, 2025
a634ca8
fix typos
Mar 18, 2025
8aefe23
fix bugs
Mar 18, 2025
0b8d663
fix bugs + replace true
Mar 18, 2025
e4e8a17
remove steps
Mar 18, 2025
0d236e8
back true
Mar 18, 2025
e58c485
add max-parallel
Mar 18, 2025
92a42c1
add apply-label-to-new-pr step
Mar 18, 2025
8863ea5
fixed + permissions
Mar 18, 2025
a41a770
fixed + permissions
Mar 18, 2025
12d526a
fixed
Mar 18, 2025
dc14f87
fixed
Mar 18, 2025
05983e3
add always()
Mar 18, 2025
d9af11a
check-labels
Mar 18, 2025
ac93761
check-labels
Mar 18, 2025
a9037b6
check-labels
Mar 18, 2025
071fced
update output
Mar 18, 2025
85f658d
update output
Mar 18, 2025
975f06b
update output
Mar 18, 2025
c38e8f1
update image name + refactoring
Mar 18, 2025
90d1e17
add git fetch origin staging
Mar 18, 2025
14fb332
without uv run
Mar 18, 2025
df0afa9
without uv run
Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: Bittensor Checks

concurrency:
group: e2e-subtensor-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- master
- staging
types: [opened, synchronize, reopened, labeled, unlabeled]

env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.event.inputs.verbose }}

jobs:
check-labels:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
outputs:
skip-tests: ${{ contains(github.event.pull_request.labels.*.name, 'skip-bittensor-tests') }}
run-cli-tests: ${{ contains(github.event.pull_request.labels.*.name, 'run-bittensor-cli-tests') }}
run-sdk-tests: ${{ contains(github.event.pull_request.labels.*.name, 'run-bittensor-sdk-tests') }}
test-files: ${{ steps.get-tests.outputs.test-files }}

steps:
- name: Check out repository
uses: actions/checkout@v4

find-tests:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
outputs:
test-files: ${{ steps.get-tests.outputs.test-files }}
steps:
- name: Find test files
id: get-tests
run: |
test_files=$(find tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "::set-output name=test-files::$test_files"
shell: bash

run-sdk-tests:
needs:
- check-labels
- find-tests
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
max-parallel: 8
matrix:
os:
- ubuntu-latest
if: needs.check-labels.outputs.run-sdk-tests == 'true'
env:
RELEASE_NAME: development
RUSTV: stable
RUST_BACKTRACE: full
RUST_BIN_DIR: target/x86_64-unknown-linux-gnu
TARGET: x86_64-unknown-linux-gnu

steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4

- name: Utilize Shared Rust Cache
uses: Swatinem/rust-cache@v2

- name: Install dependencies
run: |
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler

- name: Install Rust stable
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: stable
components: rustfmt
profile: minimal

- name: Add wasm32-unknown-unknown target
run: |
rustup target add wasm32-unknown-unknown --toolchain stable-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu

- name: Create python env
working-directory: ${{ github.workspace }}
run: |
python3 -m venv venv
source venv/bin/activate

- name: Clone Bittensor SDK repo
working-directory: ${{ github.workspace }}
run: git clone https://github.com/opentensor/bittensor.git

- name: Setup Bittensor SDK repo
working-directory: ${{ github.workspace }}/bittensor
run: |
git checkout staging
source ${{ github.workspace }}/venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install '.[dev]'
pip install maturin

- name: Clone bittensor-wallet repo
working-directory: ${{ github.workspace }}
run: git clone https://github.com/opentensor/btwallet.git

- name: Checkout PR branch
working-directory: ${{ github.workspace }}/btwallet
run: |
git fetch origin ${{ github.event.pull_request.head.ref }}
git checkout ${{ github.event.pull_request.head.ref }}
echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"

- name: Build and install Rust Bittensor Wallet package into python virtual environment
working-directory: ${{ github.workspace }}/btwallet
run: |
source ${{ github.workspace }}/venv/bin/activate
maturin develop

- name: Clone Subtensor repo
working-directory: ${{ github.workspace }}
run: git clone https://github.com/opentensor/subtensor.git

- name: Checkout Subtensor repo to `devnet-ready` branch
working-directory: ${{ github.workspace }}/subtensor
run: git checkout devnet-ready

- name: Run Bittensor SDK e2e tests
working-directory: ${{ github.workspace }}/bittensor
run: |
source ${{ github.workspace }}/venv/bin/activate
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" python3 -m pytest ${{ fromJson(needs.find-tests.outputs.test-files) }} -s

- name: Run Bittensor SDK integration tests
working-directory: ${{ github.workspace }}/bittensor
run: |
source ${{ github.workspace }}/venv/bin/activate
python3 -m pytest tests/integration_tests -s

- name: Run Bittensor SDK unit tests
working-directory: ${{ github.workspace }}/bittensor
run: |
source ${{ github.workspace }}/venv/bin/activate
python3 -m pytest tests/unit_tests -s
Loading