-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #383 from liberland/auto-fork-test
Autotesting runtime upgrade storage sanity on forked prod networks
- Loading branch information
Showing
12 changed files
with
836 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Check formatting | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: "-C debug-assertions=y" | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config git-restore-mtime | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# this is needed to make sure that cargo uses the cached target files, | ||
# which will have an older date than the checked out source code. | ||
- name: Restore files timestamps | ||
run: | | ||
# set all dirs and files mtime to the fixed timestamp, this one was chosen | ||
# symbolically as polkadot genesis block date | ||
find . -exec touch -t 202005260100 {} + | ||
# restore mtime based on git commit log | ||
git restore-mtime | ||
- name: Setup caching for rust/cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-rust-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Format code with rustfmt | ||
run: cargo fmt --check -p pallet-liberland-initializer -p pallet-liberland-legislation -p liberland-traits -p pallet-llm -p pallet-office -p pallet-registry -p pallet-custom-account -p pallet-contracts-registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Fork test | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
|
||
jobs: | ||
forktest: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: "-C debug-assertions=y" | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config git-restore-mtime moreutils | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-all-crates: "true" | ||
|
||
- name: Install check-unknowns script deps | ||
run: yarn | ||
working-directory: substrate/scripts/fork-test/check-unknowns | ||
|
||
- name: Standard prod build - mainnet | ||
run: cargo build --release | ||
|
||
- name: Run check-unknowns test on mainnet fork | ||
run: | | ||
./run-fork.sh mainnet.config.sh & | ||
cd check-unknowns | ||
timeout 5m npx ts-node src/index.ts | ||
working-directory: substrate/scripts/fork-test | ||
|
||
- name: Kill mainnet node | ||
run: killall -9 substrate-node | ||
|
||
- name: Standard prod build - bastiat | ||
run: cargo build --release -F testnet-runtime | ||
|
||
- name: Run check-unknowns test on mainnet fork | ||
run: | | ||
./run-fork.sh bastiat.config.sh & | ||
cd check-unknowns | ||
timeout 5m npx ts-node src/index.ts | ||
working-directory: substrate/scripts/fork-test | ||
|
||
- name: Kill bastiat node | ||
run: killall -9 substrate-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build and Check | ||
name: Run tests | ||
|
||
on: | ||
pull_request: | ||
|
@@ -9,56 +9,6 @@ on: | |
- main | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: "-C debug-assertions=y" | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config git-restore-mtime | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# this is needed to make sure that cargo uses the cached target files, | ||
# which will have an older date than the checked out source code. | ||
- name: Restore files timestamps | ||
run: | | ||
# set all dirs and files mtime to the fixed timestamp, this one was chosen | ||
# symbolically as polkadot genesis block date | ||
find . -exec touch -t 202005260100 {} + | ||
# restore mtime based on git commit log | ||
git restore-mtime | ||
- name: Setup caching for rust/cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-rust-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Format code with rustfmt | ||
run: cargo fmt --check -p pallet-liberland-initializer -p pallet-liberland-legislation -p liberland-traits -p pallet-llm -p pallet-office -p pallet-registry -p pallet-custom-account -p pallet-contracts-registry | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
|
@@ -86,140 +36,11 @@ jobs: | |
components: rustfmt, clippy | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
# this is needed to make sure that cargo uses the cached target files, | ||
# which will have an older date than the checked out source code. | ||
- name: Restore files timestamps | ||
run: | | ||
# set all dirs and files mtime to the fixed timestamp, this one was chosen | ||
# symbolically as polkadot genesis block date | ||
find . -exec touch -t 202005260100 {} + | ||
# restore mtime based on git commit log | ||
git restore-mtime | ||
- name: Setup caching for rust/cargo | ||
uses: actions/cache@v2 | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-rust-${{ hashFiles('**/Cargo.lock') }} | ||
cache-all-crates: "true" | ||
|
||
- name: Run cargo test suite | ||
run: cargo test -j2 --features runtime-benchmarks | ||
|
||
tryruntime: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: "-C debug-assertions=y" | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config git-restore-mtime | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# this is needed to make sure that cargo uses the cached target files, | ||
# which will have an older date than the checked out source code. | ||
- name: Restore files timestamps | ||
run: | | ||
# set all dirs and files mtime to the fixed timestamp, this one was chosen | ||
# symbolically as polkadot genesis block date | ||
find . -exec touch -t 202005260100 {} + | ||
# restore mtime based on git commit log | ||
git restore-mtime | ||
- name: Setup caching for rust/cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-rust-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Build try-runtime bastiat runtime | ||
run: cargo build --release --features try-runtime,testnet-runtime -p kitchensink-runtime | ||
|
||
- name: Install try-runtime CLI | ||
run: cargo install --git https://github.com/paritytech/try-runtime-cli --locked | ||
|
||
- name: try-runtime bastiat | ||
run: try-runtime --runtime ./target/release/wbuild/kitchensink-runtime/kitchensink_runtime.wasm on-runtime-upgrade --disable-idempotency-checks --no-weight-warnings live --uri wss://archive.testchain.liberland.org:443 | ||
|
||
- name: Build try-runtime mainnet runtime | ||
run: cargo build --release --features try-runtime -p kitchensink-runtime | ||
|
||
- name: try-runtime mainnet | ||
run: try-runtime --runtime ./target/release/wbuild/kitchensink-runtime/kitchensink_runtime.wasm on-runtime-upgrade --disable-idempotency-checks --no-weight-warnings live --uri wss://mainnet.liberland.org:443 | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: "-C debug-assertions=y" | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config git-restore-mtime | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# this is needed to make sure that cargo uses the cached target files, | ||
# which will have an older date than the checked out source code. | ||
- name: Restore files timestamps | ||
run: | | ||
# set all dirs and files mtime to the fixed timestamp, this one was chosen | ||
# symbolically as polkadot genesis block date | ||
find . -exec touch -t 202005260100 {} + | ||
# restore mtime based on git commit log | ||
git restore-mtime | ||
- name: Setup caching for rust/cargo | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-rust-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Check standard production build | ||
run: cargo build --release | ||
run: cargo test -j2 --features runtime-benchmarks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Try Runtime | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
|
||
jobs: | ||
tryruntime: | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: "-C debug-assertions=y" | ||
RUST_BACKTRACE: 1 | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler pkg-config git-restore-mtime | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-all-crates: "true" | ||
|
||
- name: Build try-runtime bastiat runtime | ||
run: cargo build --release --features try-runtime,testnet-runtime -p kitchensink-runtime | ||
|
||
- name: Install try-runtime CLI | ||
run: cargo install --git https://github.com/paritytech/try-runtime-cli --locked | ||
|
||
- name: try-runtime bastiat | ||
run: try-runtime --runtime ./target/release/wbuild/kitchensink-runtime/kitchensink_runtime.wasm on-runtime-upgrade --disable-idempotency-checks --no-weight-warnings live --uri wss://archive.testchain.liberland.org:443 | ||
|
||
- name: Build try-runtime mainnet runtime | ||
run: cargo build --release --features try-runtime -p kitchensink-runtime | ||
|
||
- name: try-runtime mainnet | ||
run: try-runtime --runtime ./target/release/wbuild/kitchensink-runtime/kitchensink_runtime.wasm on-runtime-upgrade --disable-idempotency-checks --no-weight-warnings live --uri wss://mainnet.liberland.org:443 |
Oops, something went wrong.