Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
3651e0a
try to fix AccountStore for pallet_balances config test impl
sam0x17 Mar 12, 2024
3f72542
T::BlockNumber => BlockNumberFor<T>
sam0x17 Mar 12, 2024
6d024e4
replace BlockNumber TryIntos
sam0x17 Mar 12, 2024
c8454e5
bring BuildStorage into scope in test mock pallet
sam0x17 Mar 12, 2024
449b1b3
cargo fix
sam0x17 Mar 12, 2024
69c7efb
fix more warnings
sam0x17 Mar 12, 2024
2bad57e
cargo fmt
sam0x17 Mar 12, 2024
8318db3
fix commitments pallet test config
sam0x17 Mar 12, 2024
352b25f
fix subtensor pallet test mock config
sam0x17 Mar 12, 2024
b9824bf
fix admin-utils mock test config
sam0x17 Mar 12, 2024
33d4b74
try to fix construct_runtime!
sam0x17 Mar 12, 2024
8992430
try to fix collective construct_runtime!
sam0x17 Mar 12, 2024
cb0da7c
fix collective pallet test config
sam0x17 Mar 12, 2024
00ebd86
fix missing BuildStorage import
sam0x17 Mar 12, 2024
37a5b36
fix several new_test_ext()s
sam0x17 Mar 12, 2024
a567211
apply auto formatting to all files
sam0x17 Mar 12, 2024
fd585c3
Merge remote-tracking branch 'origin/sam-cargo-fmt' into sam-upgrade-…
sam0x17 Mar 12, 2024
053726b
more fixes
sam0x17 Mar 12, 2024
4ca9272
add check for subnet lock cost
unconst Mar 13, 2024
83bc3f6
fix commitments pallet test construct_runtime!
sam0x17 Mar 13, 2024
fd42f35
fix admin-utils mock runtime and pallet_balances config
sam0x17 Mar 13, 2024
1345aee
fix subtensor mock/test construct_runtime and config
sam0x17 Mar 13, 2024
d0c7df9
remove word mint
unconst Mar 13, 2024
b223b86
remove deprecated Where section
sam0x17 Mar 15, 2024
49c2bfc
fix compile error :tada: :tada: :tada: :tada: :tada:
sam0x17 Mar 18, 2024
1f82090
Merge remote-tracking branch 'origin/main' into sam-upgrade-polkadot-1.0
sam0x17 Mar 18, 2024
4a57e9a
Add clippy to CI
keithtensor Mar 19, 2024
506b524
Perform cargo fmt check on all targets and features
keithtensor Mar 19, 2024
79044e8
Fix some clippy warnings
keithtensor Mar 19, 2024
6417b47
Fix compilation errors
keithtensor Mar 19, 2024
65af4e3
Merge pull request #266 from opentensor/keith-add-clippy-ci
sam0x17 Mar 19, 2024
2f3aa14
Fix CI
keithtensor Mar 19, 2024
e789084
Install rustfmt and clippy on CI
keithtensor Mar 19, 2024
4e626ba
Disable checking of all targets and features
keithtensor Mar 19, 2024
667b4a5
Install the right nightly
keithtensor Mar 19, 2024
6e23b3f
Make sure we're using the right year of the nightly
keithtensor Mar 19, 2024
1b2b526
Remove try-runtime subcommand
keithtensor Mar 19, 2024
e8c6a91
fix existential deposit issue
sam0x17 Mar 19, 2024
e5e2235
fix: clippy
Mar 19, 2024
86ef251
sam revamp CI
sam0x17 Mar 19, 2024
297ae3b
fix typo
sam0x17 Mar 19, 2024
9f6f3c9
make CI names shorter because omg it's so long
sam0x17 Mar 19, 2024
64bc003
add CI check asserting that cargo fix --workspace has no local changes
sam0x17 Mar 19, 2024
73007b4
temporary fix for test_registration_difficulty_adjustment failure
sam0x17 Mar 19, 2024
05e1026
Move Cargo.toml lints into CLI flags
keithtensor Mar 20, 2024
e6fa919
Fix YAML syntax
keithtensor Mar 20, 2024
e1dcc70
Fix YAML syntax
keithtensor Mar 20, 2024
260023d
Fix clippy CLI syntax
keithtensor Mar 20, 2024
7fef8c9
Deny panics
keithtensor Mar 20, 2024
8e64ffc
Do proper multiline syntax
keithtensor Mar 21, 2024
e849d1c
Allow unreachable macros again in clippy
keithtensor Mar 21, 2024
83e7e3b
Merge remote-tracking branch 'origin/main' into sam-upgrade-polkadot-1.0
sam0x17 Mar 22, 2024
d0c6639
add comment
sam0x17 Mar 22, 2024
8d0395d
fix deprecation warning for NativeElseWasmExecutor::new
sam0x17 Mar 22, 2024
0e991b4
remove remote_keystore function (no longer needed)
sam0x17 Mar 22, 2024
8de291c
remove unnecessary mut
sam0x17 Mar 22, 2024
8d490e4
remove some unused imports
sam0x17 Mar 22, 2024
34cb539
fix a bunch of data_type deprecation warnings
sam0x17 Mar 22, 2024
cd54ab0
remove deprecated generate_store
sam0x17 Mar 22, 2024
7dfddef
remove unused param
sam0x17 Mar 22, 2024
b47c2bb
remove more deprecations and unused imports
sam0x17 Mar 22, 2024
48fda02
remove deprecated `close_old_weight`
sam0x17 Mar 22, 2024
04cadac
use dev_mode for mock test pallet instead of deprecated #[weight(0)]
sam0x17 Mar 22, 2024
3ef1942
GenesisConfig => RuntimeGenesisConfig for collective pallet
sam0x17 Mar 22, 2024
8e86851
silence useless warning coming from a macro expansion
sam0x17 Mar 22, 2024
7d55509
comment out dead code
sam0x17 Mar 22, 2024
0c66fca
collective pallet clean / no warnings :tada:
sam0x17 Mar 22, 2024
0dea481
add missing unwrap() to test
sam0x17 Mar 22, 2024
59a7101
comment out unused method
sam0x17 Mar 22, 2024
798762b
fix commitments pallet test warnings
sam0x17 Mar 22, 2024
0fd50c0
fix commitments pallet data types warnings
sam0x17 Mar 22, 2024
182a2d3
remove unused import
sam0x17 Mar 22, 2024
35444ae
fix root pallet test warnings
sam0x17 Mar 22, 2024
0ee4f0e
fix imporperly named enum variant
sam0x17 Mar 22, 2024
c0862ff
fix several mispellings
sam0x17 Mar 22, 2024
d87bf88
fix mispelled type name
sam0x17 Mar 22, 2024
c9b2477
fix more warnings
sam0x17 Mar 22, 2024
d47e2ce
fix a really weird/annoying warning
sam0x17 Mar 22, 2024
0d707c5
fix another, similar weird warning
sam0x17 Mar 22, 2024
2e9f93c
fix more warnings and spelling errors
sam0x17 Mar 22, 2024
c1c58e7
fix more warnings
sam0x17 Mar 22, 2024
f23cf38
fix more warnings
sam0x17 Mar 22, 2024
0d20682
remove unused deposit event
sam0x17 Mar 22, 2024
835a0f5
add missing unwraps to tests
sam0x17 Mar 22, 2024
afc7bf8
fix more warnings
sam0x17 Mar 22, 2024
3554b41
fix more warnings
sam0x17 Mar 22, 2024
f77d90e
fix improper use of pub (crate)
sam0x17 Mar 22, 2024
4adbb6b
another improper import
sam0x17 Mar 22, 2024
ceb563d
fix more warnings
sam0x17 Mar 22, 2024
37c7554
no more warnings :tada: :tada: :boom: :boom:
sam0x17 Mar 22, 2024
b77984e
sanity check block number
sam0x17 Mar 22, 2024
fd7e6a6
verify issue
sam0x17 Mar 22, 2024
d7e70a0
Merge branch 'main' into issuance
unconst Mar 23, 2024
3bff4c5
WIP
sam0x17 Mar 24, 2024
89fdffb
tiny fixes & improvements
cuteolaf Mar 25, 2024
6a2133d
don't assume block number is 0 at start of test
sam0x17 Mar 25, 2024
125d42f
test_bond now passing, use new `next_block()` abstraction
sam0x17 Mar 25, 2024
be2742d
Merge branch 'main' into tiny-fixes
cuteolaf Mar 25, 2024
2def33b
fix test_active_stake()
sam0x17 Mar 25, 2024
cdcf600
fix test_registration_invalid_block_number
sam0x17 Mar 25, 2024
e96925d
fix test_registration_get_uid_to_prune_node_in_immunity_period
sam0x17 Mar 25, 2024
1755064
fix test_registration_get_uid_to_prune_all_in_immunity_period
sam0x17 Mar 25, 2024
f4127f2
fix test_root_set_weights()
sam0x17 Mar 25, 2024
aaa9e85
fix test_root_set_weights_out_of_order_netuids
sam0x17 Mar 25, 2024
5cee3a5
fix test_root_subnet_creation_deletion
sam0x17 Mar 25, 2024
2a3deee
fix test_network_pruning
sam0x17 Mar 25, 2024
c09aa1b
fix misspellings
sam0x17 Mar 25, 2024
ea79fa2
hard-code block number 0 in subtensor mock tests
sam0x17 Mar 25, 2024
0eb6b61
never mind
sam0x17 Mar 25, 2024
5f23061
Migrate from Currency trait to fungible traits
keithtensor Mar 25, 2024
ac2c04d
cargo fmt
keithtensor Mar 25, 2024
f10a506
implement registration filtering
JohnReedV Mar 25, 2024
82dff25
test registration filtering
JohnReedV Mar 25, 2024
a43acb1
improve test
JohnReedV Mar 26, 2024
487cd74
filter burned_register calls too
JohnReedV Mar 26, 2024
5967bd1
add tests for burned registration filtering
JohnReedV Mar 26, 2024
5efec11
move comment
JohnReedV Mar 26, 2024
1416248
implement stake & unstake rate limits
JohnReedV Mar 26, 2024
25db036
add tests for stake & unstake rate limits
JohnReedV Mar 26, 2024
f6c1d34
fix new errors in old tests
JohnReedV Mar 26, 2024
9ff231d
add unstakes to test_reset_stakes_per_interval
JohnReedV Mar 26, 2024
3c4a9f3
remove unstake trackers
JohnReedV Mar 27, 2024
b9b7c47
emission schedule
unconst Mar 28, 2024
ebeca50
check block emissions value
unconst Mar 28, 2024
bbd1237
remove take changes
JohnReedV Mar 28, 2024
a7da937
Disable some clippy lints
keithtensor Mar 28, 2024
965f494
Try indenting
keithtensor Mar 28, 2024
9cac574
Remove commented out lines
keithtensor Mar 28, 2024
696a893
Active CI when pushing or PRing against development branch
keithtensor Mar 28, 2024
da0f03d
make halving work
JohnReedV Mar 29, 2024
bc19e2d
add halving tests
JohnReedV Mar 29, 2024
82c2f8e
fix comments
JohnReedV Mar 29, 2024
4a8812a
fix typos
JohnReedV Mar 29, 2024
43af82b
test greater than total supply
JohnReedV Mar 29, 2024
5a1869a
use existing log2
JohnReedV Mar 29, 2024
1166244
remove powf()
JohnReedV Mar 29, 2024
9f43c16
remove unused import
JohnReedV Mar 29, 2024
41ca7b5
fix CI not running
sam0x17 Mar 29, 2024
9d22b20
remove $default-branch
sam0x17 Mar 29, 2024
dc2ba73
try exactly matching keith's branch
sam0x17 Mar 29, 2024
a6194fa
Merge pull request #291 from opentensor/sam-fix-ci-not-running-on-dev…
sam0x17 Mar 29, 2024
1b30fdc
bump CI for sanity purposes
sam0x17 Mar 29, 2024
667a97a
Merge remote-tracking branch 'origin/development' into sam-upgrade-po…
sam0x17 Mar 29, 2024
2912513
remove paths constraint from CI
sam0x17 Mar 29, 2024
4fcf5f8
Fix tests and prevent accounts from dropping below ED while staking
keithtensor Mar 29, 2024
6e78810
Fixes
keithtensor Mar 29, 2024
cffb8eb
Merge pull request #292 from opentensor/sam-fix-ci-2
sam0x17 Mar 29, 2024
56e36a3
Merge remote-tracking branch 'origin/development' into emission_schedule
sam0x17 Mar 29, 2024
f6fc0ab
Pre-check for a 0 amount before withdrawal
keithtensor Mar 29, 2024
b4ea027
Merge branch 'development' into sam-upgrade-polkadot-1.0
keithtensor Mar 29, 2024
a56a689
Merge remote-tracking branch 'origin/development' into Registrations_…
sam0x17 Mar 29, 2024
a38d7f1
adds test on 21M convergence
unconst Apr 1, 2024
5f81871
cargo fmt
JohnReedV Apr 1, 2024
1cd2d10
Update test expectations
keithtensor Apr 2, 2024
101ce88
Merge pull request #290 from opentensor/emission_schedule
sam0x17 Apr 2, 2024
9c79891
Merge remote-tracking branch 'origin/development' into issuance
sam0x17 Apr 2, 2024
7ded5af
cargo fmt
sam0x17 Apr 2, 2024
8504e1d
Use actual block number instead of assuming 0
keithtensor Apr 2, 2024
8ee0b70
Merge branch 'development' into sam-upgrade-polkadot-1.0
keithtensor Apr 2, 2024
da56cae
Make block number a parameter to new_test_ext
keithtensor Apr 2, 2024
fdff101
prevent multiple stake TXs in pool
JohnReedV Apr 2, 2024
9af876e
add changeable staking interval
JohnReedV Apr 3, 2024
81119da
readd setters
JohnReedV Apr 3, 2024
27a1a27
move setters to execution
JohnReedV Apr 3, 2024
ffa8811
fix new bug in old test
JohnReedV Apr 3, 2024
b625c46
Merge pull request #254 from opentensor/issuance
sam0x17 Apr 3, 2024
34617b2
Merge pull request #285 from opentensor/Registrations_Signed_Extensio…
sam0x17 Apr 3, 2024
dfaa26e
Merge branch 'development' into add_rate_limit_on_staking_transactions
JohnReedV Apr 4, 2024
4d0b7b2
cargo fmt
JohnReedV Apr 4, 2024
94e6e39
fix benchmarking test
open-junius Apr 4, 2024
a014285
Merge pull request #287 from opentensor/add_rate_limit_on_staking_tra…
sam0x17 Apr 4, 2024
8b5e73d
clean compile cache
open-junius Apr 4, 2024
abfda0a
Merge remote-tracking branch 'origin/development' into sam-upgrade-po…
keithtensor Apr 4, 2024
855c451
Fix compilation errors
keithtensor Apr 4, 2024
412de1b
Fix test
keithtensor Apr 4, 2024
9e76569
Assign u64 to the Currency::Balance type in subtensor pallet
keithtensor Apr 5, 2024
7c8839d
cargo fmt
keithtensor Apr 5, 2024
895c3cf
Update spec version to 145
keithtensor Apr 5, 2024
257e883
comment out unneeded line
sam0x17 Apr 5, 2024
6b9c827
fix missing newline
sam0x17 Apr 5, 2024
18f2c94
Merge pull request #252 from opentensor/sam-upgrade-polkadot-1.0
sam0x17 Apr 8, 2024
db3d92a
init the tiny fix
open-junius Apr 8, 2024
ea89021
grandpa rpc
open-junius Apr 8, 2024
a85075f
remove commented code
open-junius Apr 9, 2024
42b3873
Merge pull request #299 from opentensor/junius/tiny-fixes
open-junius Apr 9, 2024
ba16ece
Merge pull request #302 from opentensor/junius/connect-grandpa-rpc
open-junius Apr 9, 2024
5823e93
dtao
Mar 11, 2024
9443370
initial
unconst Mar 13, 2024
31dbb1b
remove duplicate imports
unconst Mar 14, 2024
36d9fce
no red tests
unconst Mar 14, 2024
852ddbc
tests are green
unconst Mar 14, 2024
3380023
add subnet stake yuma
unconst Mar 15, 2024
3dc567c
weights
unconst Mar 15, 2024
0614aad
fix index
unconst Mar 23, 2024
3ff711d
no root stake
unconst Mar 23, 2024
c8048a2
fix divide by zero
unconst Mar 23, 2024
55329d3
fix tests
unconst Mar 23, 2024
f25b56d
fix stao epoch
unconst Mar 27, 2024
6d3e1d6
feat: draft migration , subnet staking info rpcs
Mar 23, 2024
b9b5e77
feat: migration + tests
Mar 25, 2024
74627ed
feat: refunds stakes on removed subnets
Mar 25, 2024
eac30ac
feat: e2e subnet staking test
Mar 25, 2024
3ef38d7
chore: stash
Mar 25, 2024
22c6eec
fix: remove println and add subnet api trait impls
Mar 25, 2024
c12c7d4
feat: different subnet stake tests
Mar 25, 2024
9930c40
chore: more neuron_info tests
Mar 26, 2024
9fdf109
feat: subnet staking rpcs
Mar 26, 2024
f709815
feat: subnet staking rpc tests
Mar 26, 2024
cd5b0ad
return stake for root v subnet stake
Mar 26, 2024
d7f081a
fix: neuron_lite
Mar 26, 2024
1b8168a
stash
unconst Mar 28, 2024
0d1ebb3
s
unconst Apr 1, 2024
7593ef9
add proportional take
unconst Apr 3, 2024
fe8a30f
green tests
unconst Apr 4, 2024
4972314
fix
unconst Apr 4, 2024
6fab490
fix
unconst Apr 4, 2024
4f21ef9
tests are green
unconst Apr 4, 2024
3d58d3e
feat: all stakes attached to cooldkey rpc
Mar 27, 2024
d692a7c
fix: more neuron info debugging
Mar 28, 2024
7ad13d5
chore: assert stake info remains same for subnets not added
Mar 28, 2024
58d6945
chore: bump spec version to 181
Mar 28, 2024
43670a6
chore: rpc tests boilerplate
Apr 3, 2024
6cbdcb7
chore: stash
Apr 4, 2024
b6ed6e1
feat: complete test set up
Apr 4, 2024
d9597cb
adds getters setters for global_stake weight and stake emissions
unconst Apr 4, 2024
16386dd
remove spurious call to netuid
unconst Apr 5, 2024
27f255d
remove log files
unconst Apr 5, 2024
b4db623
add stao feature
unconst Apr 5, 2024
07a44f7
remove alice
unconst Apr 5, 2024
630f2dd
fix faucet
unconst Apr 5, 2024
ea2ff80
Add RPC tests for get_all_stake_info_for_coldkey and get_delegates
gregzaitsev Apr 9, 2024
67afb59
feat: v1.0 rebase changes
Apr 10, 2024
55cba98
fix: comment out rpcs tests , fix blockstep tests
Apr 10, 2024
7a82a33
feat: all tests green
Apr 10, 2024
0ac0a80
chore: lints
Apr 10, 2024
44351fc
Allow to also increase take, add tests
gregzaitsev Apr 10, 2024
9080a94
Rename rate limiting identifiers to match pattern, enforce take bound…
gregzaitsev Apr 11, 2024
ddb3405
Update pallets/subtensor/src/staking.rs
unconst Mar 27, 2024
58d4fad
Update pallets/subtensor/src/lib.rs
unconst Mar 27, 2024
b725dc3
Update pallets/subtensor/src/staking.rs
unconst Mar 27, 2024
44f409a
comment nit
sam0x17 Apr 8, 2024
d2eafc7
fix comment
sam0x17 Apr 8, 2024
0cf36ac
fix comment
sam0x17 Apr 8, 2024
1e66940
fix comment
sam0x17 Apr 8, 2024
b99d478
Allow to also increase take, add tests
gregzaitsev Apr 10, 2024
6d098dc
Rename rate limiting identifiers to match pattern, enforce take bound…
gregzaitsev Apr 11, 2024
2b779ac
Merge branch 'feature/increase_delegate_take' of github.com:opentenso…
gregzaitsev Apr 11, 2024
919066d
Cleanup after rebase to stao branch
gregzaitsev Apr 11, 2024
78466fb
Fix tests after rebasing to stao
gregzaitsev Apr 11, 2024
fadce26
Fix warnings
gregzaitsev Apr 11, 2024
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
307 changes: 260 additions & 47 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
name: Rust build, benchmarks, and tests
name: CI

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

##

on:
##
# Run automatically for any push that changes Rust file(s)
## Run automatically for all PRs against main, regardless of what the changes are
## to be safe and so we can more easily force re-run the CI when github is being
## weird by using a blank commit
push:
branches:
- main
- $default-branch

paths:
- "**.rs"
- "**/Cargo.toml"
- "**/Cargo.lock"
branches: [main, development, staging]

##
# Run automatically for PRs against default/main branch if Rust files change
pull_request:
branches:
- main
- $default-branch

paths:
- "**.rs"
- "**/Cargo.toml"
- "**/Cargo.lock"
branches: [main, development, staging]

## Allow running workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -38,83 +25,309 @@ on:
required: false
default: ""

##
env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.events.input.verbose }}

##
#
jobs:
check:
name: Tests targeting ${{ matrix.rust-target }} for OS ${{ matrix.os }}
# runs cargo fmt
cargo-fmt:
name: cargo fmt
runs-on: SubtensorCI

##
# Define multiple targets for builds and tests
strategy:
matrix:
rust-branch:
- nightly-2023-01-18

- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential

- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt
profile: minimal

- name: cargo fmt
run: cargo fmt --check --all

# runs cargo check --workspace
cargo-check:
name: cargo check
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@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 ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Shared Rust Cache
uses: Swatinem/rust-cache@v2.2.1
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo check --workspace
run: cargo check --workspace

# runs cargo test --workspace
cargo-test:
name: cargo test
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@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 ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Rust shared cached
uses: Swatinem/rust-cache@v2.2.1
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

##
- name: cargo test --workspace
run: cargo test --workspace

# runs cargo test --workspace --features=runtime-benchmarks
cargo-test-benchmarks:
name: cargo test w/benchmarks
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
RUSTFLAGS: -A warnings
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@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 ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Rust shared cached
uses: Swatinem/rust-cache@v2.2.1
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo test --workspace --features=runtime-benchmarks
run: cargo test --workspace --features=runtime-benchmarks

# runs cargo clippy
clippy:
name: cargo clippy
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

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

- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Rust shared cached
uses: Swatinem/rust-cache@v2.2.1
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo fmt
run: cargo fmt --check
- name: cargo clippy
run: |
cargo clippy -- -D clippy::panic \
-D clippy::todo \
-D clippy::unimplemented
# -D clippy::indexing_slicing \
# -D clippy::unwrap_used \

## TODO: maybe use `if` conditions in tests to target `--package <name>`
- name: cargo test
# timeout-minutes: 30
run: cargo test --workspace
# ensures cargo fix has no trivial changes that can be applied
cargo-fix:
name: cargo fix
runs-on: SubtensorCI
strategy:
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
env:
RELEASE_NAME: development
# RUSTFLAGS: -A warnings
RUSTV: ${{ matrix.rust-branch }}
RUST_BACKTRACE: full
RUST_BIN_DIR: target/${{ matrix.rust-target }}
SKIP_WASM_BUILD: 1
TARGET: ${{ matrix.rust-target }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Run benchmarks
# timeout-minutes: 30
- name: Install dependencies
run: |
pushd node &&
cargo build --features=runtime-benchmarks --release
sudo apt-get update &&
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler

- name: Build executable
# timeout-minutes: 30
run: cargo build --release
- name: Install Rust ${{ matrix.rust-branch }}
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: ${{ matrix.rust-branch }}
components: rustfmt, clippy
profile: minimal

- name: Utilize Rust shared cached
uses: Swatinem/rust-cache@v2.2.1
with:
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}

- name: cargo fix --workspace
run: |
# Run cargo fix on the project
cargo fix --workspace

# Check for local git changes
if ! git diff --exit-code; then
echo "There are local changes after running 'cargo fix --workspace' ❌"
exit 1
else
echo "No changes detected after running 'cargo fix --workspace' ✅"
fi
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ specs/*.json
*.orig

# VSCode configuration
.vscode
.vscode

alice.log
bob.log
Loading