From 8ab3b7b06c85eb19aefb013d1df13e5c1afffa0d Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 28 Nov 2023 10:38:03 +0100 Subject: [PATCH 01/28] add coverage report for ci --- .github/workflows/check.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 04af2420e..802481ceb 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -28,6 +28,10 @@ jobs: rustup update stable --no-self-update rustup target add wasm32-unknown-unknown + - name: Install Tarpaulin + run: | + cargo install cargo-tarpaulin + - name: Check TOML uses: dprint/check@v2.2 @@ -50,3 +54,13 @@ jobs: run: > pushd node && cargo check --features=runtime-benchmarks --release + + - name: Run Coverage + run: | + cargo tarpaulin --verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml" + + - name: Upload coverage report + uses: actions/upload-artifact@v3 + with: + name: tarpaulin coverage + path: ./tarpaulin-report.xml \ No newline at end of file From 9dcb095e978a08b37208cfdf75cbdc1a1274396c Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 28 Nov 2023 12:03:09 +0100 Subject: [PATCH 02/28] add tarapulin using github actions --- .github/workflows/check.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 802481ceb..af1d460e0 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -28,10 +28,6 @@ jobs: rustup update stable --no-self-update rustup target add wasm32-unknown-unknown - - name: Install Tarpaulin - run: | - cargo install cargo-tarpaulin - - name: Check TOML uses: dprint/check@v2.2 @@ -46,6 +42,12 @@ jobs: run: | cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.15.0' + args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' + - name: Check Build run: | SKIP_WASM_BUILD=1 cargo check --release @@ -55,10 +57,6 @@ jobs: pushd node && cargo check --features=runtime-benchmarks --release - - name: Run Coverage - run: | - cargo tarpaulin --verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml" - - name: Upload coverage report uses: actions/upload-artifact@v3 with: From 893e330641df956ca492d4e5e7b53440f3e76cf5 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 28 Nov 2023 12:12:33 +0100 Subject: [PATCH 03/28] quick fix --- .github/workflows/check.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index af1d460e0..e81ed35e9 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -42,11 +42,11 @@ jobs: run: | cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - with: - version: '0.15.0' - args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.15.0' + args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' - name: Check Build run: | From 2225a729d833e314089d988fb133924bbf438496 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Wed, 29 Nov 2023 11:37:07 +0100 Subject: [PATCH 04/28] update runner machine --- .github/workflows/check.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index e81ed35e9..25c26c643 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -9,11 +9,15 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +permissions: + id-token: write + contents: read + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: check: # The type of runner that the job will run on - runs-on: ubuntu-22.04 + runs-on: '["self-hosted", "cere-network-xlarge-workers"]' # Steps represent a sequence of tasks that will be executed as part of the job steps: From 2a6765fcc18b716824e742b2b5e32a3161cef1d1 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Fri, 1 Dec 2023 14:46:15 +0100 Subject: [PATCH 05/28] change xlarge nodes to large --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 25c26c643..2d96df979 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -17,7 +17,7 @@ permissions: jobs: check: # The type of runner that the job will run on - runs-on: '["self-hosted", "cere-network-xlarge-workers"]' + runs-on: '["self-hosted", "cere-network-large-workers"]' # Steps represent a sequence of tasks that will be executed as part of the job steps: From 943895ddbd8905538ff635e14f51303ddad6c7a2 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 12:33:31 +0100 Subject: [PATCH 06/28] fix error in check.yaml --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 2d96df979..e014351e0 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -17,7 +17,7 @@ permissions: jobs: check: # The type of runner that the job will run on - runs-on: '["self-hosted", "cere-network-large-workers"]' + runs-on: ["self-hosted", "cere-network-xlarge-workers"] # Steps represent a sequence of tasks that will be executed as part of the job steps: From 8b56a47a6dc3053b2d849f2933119dd96d9a5c40 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 13:04:09 +0100 Subject: [PATCH 07/28] fix actions version in check.yaml --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index e014351e0..88d468ccb 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -22,7 +22,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - name: Install linux dependencies run: sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler From ce1b9db668fe91e0c27be1974c9e238e09716250 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 13:40:43 +0100 Subject: [PATCH 08/28] add apt update --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 88d468ccb..1c3ba4a02 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - name: Install linux dependencies - run: sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler + run: sudo apt update && sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler - name: Install Rust run: | From f5b34b2d38d71f416be118b5fc8108f32017b3dc Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 13:59:49 +0100 Subject: [PATCH 09/28] install rust --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 1c3ba4a02..abaf47f45 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - name: Install linux dependencies - run: sudo apt update && sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler + run: rustup && sudo apt update && sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler - name: Install Rust run: | From acdf5c4aa21f23099718e490508d6c82b7a46534 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 14:16:16 +0100 Subject: [PATCH 10/28] install rustup --- .github/workflows/check.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index abaf47f45..7b240131a 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -25,8 +25,13 @@ jobs: - uses: actions/checkout@v3 - name: Install linux dependencies - run: rustup && sudo apt update && sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler + run: sudo apt update && sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler + - name: install rustup + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh + sh rustup-init.sh -y --default-toolchain none + - name: Install Rust run: | rustup update stable --no-self-update From 04f22b7223130201b575f54c68645bbdaf81447d Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 14:33:11 +0100 Subject: [PATCH 11/28] update rustup setup --- .github/workflows/check.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 7b240131a..9f3bcf289 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -27,13 +27,12 @@ jobs: - name: Install linux dependencies run: sudo apt update && sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler - - name: install rustup - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh - sh rustup-init.sh -y --default-toolchain none - - name: Install Rust run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + source ~/.cargo/env + rustup default stable + rustup update nightly rustup update stable --no-self-update rustup target add wasm32-unknown-unknown From f1ca49b825b95b589d804aeba6fe1971e2bfc838 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 14:38:56 +0100 Subject: [PATCH 12/28] update rustup setup --- .github/workflows/check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 9f3bcf289..6a238e8be 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -35,6 +35,7 @@ jobs: rustup update nightly rustup update stable --no-self-update rustup target add wasm32-unknown-unknown + export PATH="$HOME/.cargo/bin:$PATH" - name: Check TOML uses: dprint/check@v2.2 From 9b6af5c425c6bfccf005f22f8c41f5c0d4e12509 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 16:08:06 +0100 Subject: [PATCH 13/28] update rustup setup --- .github/workflows/check.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 6a238e8be..8d98a83f3 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -30,12 +30,13 @@ jobs: - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source ~/.cargo/env + source ~/.bashrc rustup default stable rustup update nightly rustup update stable --no-self-update rustup target add wasm32-unknown-unknown export PATH="$HOME/.cargo/bin:$PATH" + source ~/.bashrc - name: Check TOML uses: dprint/check@v2.2 From 947590895cf4f0358f02d1ff5fae7a56ae84938f Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 16:13:04 +0100 Subject: [PATCH 14/28] update rustup setup --- .github/workflows/check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 8d98a83f3..568217a48 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -30,13 +30,13 @@ jobs: - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source ~/.bashrc + source "~/.cargo/env" rustup default stable rustup update nightly rustup update stable --no-self-update rustup target add wasm32-unknown-unknown export PATH="$HOME/.cargo/bin:$PATH" - source ~/.bashrc + source "~/.cargo/env" - name: Check TOML uses: dprint/check@v2.2 From 4ac8b72a6f103f1f083371343f44976c606955f3 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 16:13:31 +0100 Subject: [PATCH 15/28] update rustup setup --- .github/workflows/check.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 568217a48..4baab8ff6 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - name: Install linux dependencies - run: sudo apt update && sudo apt install -y clang libssl-dev llvm libudev-dev protobuf-compiler + run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler - name: Install Rust run: | @@ -36,7 +36,6 @@ jobs: rustup update stable --no-self-update rustup target add wasm32-unknown-unknown export PATH="$HOME/.cargo/bin:$PATH" - source "~/.cargo/env" - name: Check TOML uses: dprint/check@v2.2 From c63bbc3db50c467c1902d57da64fa684b4324464 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 16:15:35 +0100 Subject: [PATCH 16/28] update rustup setup --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 4baab8ff6..55f817a3f 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -30,7 +30,7 @@ jobs: - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source "~/.cargo/env" + source "$HOME/.cargo/env" rustup default stable rustup update nightly rustup update stable --no-self-update From 1e8a940fb30ea53299c756c661ac715f432a38ea Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 18:51:57 +0100 Subject: [PATCH 17/28] update rustup setup --- .github/workflows/check.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 55f817a3f..bb122cbab 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -31,7 +31,8 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" - rustup default stable + rustup install install 1.70.0 + rustup default 1.70.0 rustup update nightly rustup update stable --no-self-update rustup target add wasm32-unknown-unknown @@ -59,7 +60,7 @@ jobs: - name: Check Build run: | - SKIP_WASM_BUILD=1 cargo check --release + SKIP_WASM_BUILD=1 cargo +1.70.0 check --release - name: Check Build for Benchmarking run: > From 647a69a7d434e7c81e105b83a947a8e1b3c3ce27 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 18:53:54 +0100 Subject: [PATCH 18/28] update rustup setup --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index bb122cbab..7cfade87a 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -31,7 +31,7 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" - rustup install install 1.70.0 + rustup install 1.70.0 rustup default 1.70.0 rustup update nightly rustup update stable --no-self-update From 46c3975190a6580b21a3ea8a71e79a797265d164 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 4 Dec 2023 20:35:32 +0100 Subject: [PATCH 19/28] update rustup setup --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 7cfade87a..5294658e3 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -60,7 +60,7 @@ jobs: - name: Check Build run: | - SKIP_WASM_BUILD=1 cargo +1.70.0 check --release + SKIP_WASM_BUILD=1 cargo check --release - name: Check Build for Benchmarking run: > From 921bc2a6b56a2349b26c1d25db956d6f3cd4def2 Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 11:12:40 +0300 Subject: [PATCH 20/28] Remove is_some_and --- pallets/ddc-clusters/src/lib.rs | 1 - pallets/ddc-staking/src/lib.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/pallets/ddc-clusters/src/lib.rs b/pallets/ddc-clusters/src/lib.rs index 73cf62932..b6253ce0b 100644 --- a/pallets/ddc-clusters/src/lib.rs +++ b/pallets/ddc-clusters/src/lib.rs @@ -13,7 +13,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] -#![feature(is_some_and)] // ToDo: delete at rustc > 1.70 pub mod weights; use crate::weights::WeightInfo; diff --git a/pallets/ddc-staking/src/lib.rs b/pallets/ddc-staking/src/lib.rs index f012c35dc..e05a1b716 100644 --- a/pallets/ddc-staking/src/lib.rs +++ b/pallets/ddc-staking/src/lib.rs @@ -13,7 +13,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] -#![feature(is_some_and)] // ToDo: delete at rustc > 1.70 #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; From 0abd5e7b46b292fb1b4eed0a0e771f67467ae5ea Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 11:48:38 +0300 Subject: [PATCH 21/28] Update tarpaulin version --- .github/workflows/check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 5294658e3..d8ed4b08b 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -55,7 +55,7 @@ jobs: - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: - version: '0.15.0' + version: '0.27.2' args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' - name: Check Build @@ -71,4 +71,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: tarpaulin coverage - path: ./tarpaulin-report.xml \ No newline at end of file + path: ./tarpaulin-report.xml From 3a3e1db53857a572e9a9955ed4b1edd4d05acc42 Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 12:10:16 +0300 Subject: [PATCH 22/28] Use nightly --- .github/workflows/check.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index d8ed4b08b..7f0cef09c 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -31,10 +31,8 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" - rustup install 1.70.0 - rustup default 1.70.0 + rustup default nightly rustup update nightly - rustup update stable --no-self-update rustup target add wasm32-unknown-unknown export PATH="$HOME/.cargo/bin:$PATH" From 71c9c778ccb6ba631298d07030c47f74390022cc Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 12:48:03 +0300 Subject: [PATCH 23/28] Restore removed annotations and use rust-toolchain config in root --- .github/workflows/check.yaml | 1 - pallets/ddc-clusters/src/lib.rs | 1 + pallets/ddc-staking/src/lib.rs | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 7f0cef09c..c9bd87f1b 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -32,7 +32,6 @@ jobs: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" rustup default nightly - rustup update nightly rustup target add wasm32-unknown-unknown export PATH="$HOME/.cargo/bin:$PATH" diff --git a/pallets/ddc-clusters/src/lib.rs b/pallets/ddc-clusters/src/lib.rs index b6253ce0b..73cf62932 100644 --- a/pallets/ddc-clusters/src/lib.rs +++ b/pallets/ddc-clusters/src/lib.rs @@ -13,6 +13,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] +#![feature(is_some_and)] // ToDo: delete at rustc > 1.70 pub mod weights; use crate::weights::WeightInfo; diff --git a/pallets/ddc-staking/src/lib.rs b/pallets/ddc-staking/src/lib.rs index e05a1b716..f012c35dc 100644 --- a/pallets/ddc-staking/src/lib.rs +++ b/pallets/ddc-staking/src/lib.rs @@ -13,6 +13,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] +#![feature(is_some_and)] // ToDo: delete at rustc > 1.70 #[cfg(feature = "runtime-benchmarks")] pub mod benchmarking; From a6c0c88ddcd1ae9eeb173a1bf95647456db913a3 Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 13:17:57 +0300 Subject: [PATCH 24/28] Fix tarpaulin version --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index c9bd87f1b..b0ed42073 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -52,7 +52,7 @@ jobs: - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 with: - version: '0.27.2' + version: '0.22.0' args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' - name: Check Build From 329e75544248d1cdb2856b5c482fc088b6ab02b2 Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Tue, 5 Dec 2023 12:33:21 +0100 Subject: [PATCH 25/28] install nightly --- .github/workflows/check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index b0ed42073..abe62cdab 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -31,6 +31,7 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" + rustup toolchain install nightly rustup default nightly rustup target add wasm32-unknown-unknown export PATH="$HOME/.cargo/bin:$PATH" From af7199e28088078f7954740fbc0e8431be2d6a30 Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 14:51:24 +0300 Subject: [PATCH 26/28] Specific nightly build --- .github/workflows/check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index abe62cdab..424a1644f 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -31,7 +31,7 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" - rustup toolchain install nightly + rustup toolchain install nightly-2022-10-09 rustup default nightly rustup target add wasm32-unknown-unknown export PATH="$HOME/.cargo/bin:$PATH" From 9d135b3c50803b7ffaf7e56dd032a6b54f83b016 Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 16:12:45 +0300 Subject: [PATCH 27/28] Test installing toolchain through an action --- .github/workflows/check.yaml | 57 ++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 424a1644f..03857bfbd 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -27,28 +27,35 @@ jobs: - name: Install linux dependencies run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source "$HOME/.cargo/env" - rustup toolchain install nightly-2022-10-09 - rustup default nightly - rustup target add wasm32-unknown-unknown - export PATH="$HOME/.cargo/bin:$PATH" + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly-2022-10-09 + override: true + target: wasm32-unknown-unknown + + # - name: Install Rust + # run: | + # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + # source "$HOME/.cargo/env" + # rustup toolchain install nightly-2022-10-09 + # rustup default nightly + # rustup target add wasm32-unknown-unknown --toolchain nightly + # export PATH="$HOME/.cargo/bin:$PATH" - - name: Check TOML - uses: dprint/check@v2.2 + # - name: Check TOML + # uses: dprint/check@v2.2 - - name: Check Format - run: | - cargo fmt -- --check + # - name: Check Format + # run: | + # cargo fmt -- --check - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + # - name: Rust Cache + # uses: Swatinem/rust-cache@v2 - - name: Check with Clippy - run: | - cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings + # - name: Check with Clippy + # run: | + # cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 @@ -56,14 +63,14 @@ jobs: version: '0.22.0' args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' - - name: Check Build - run: | - SKIP_WASM_BUILD=1 cargo check --release + # - name: Check Build + # run: | + # SKIP_WASM_BUILD=1 cargo check --release - - name: Check Build for Benchmarking - run: > - pushd node && - cargo check --features=runtime-benchmarks --release + # - name: Check Build for Benchmarking + # run: > + # pushd node && + # cargo check --features=runtime-benchmarks --release - name: Upload coverage report uses: actions/upload-artifact@v3 From 0498532e6faef3eaa4dfa6bf06f1ea96e00b66d9 Mon Sep 17 00:00:00 2001 From: rakanalh Date: Tue, 5 Dec 2023 16:43:01 +0300 Subject: [PATCH 28/28] Restore removed parts --- .github/workflows/check.yaml | 43 ++++++++++++++---------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 03857bfbd..04e9d71cd 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -34,28 +34,19 @@ jobs: override: true target: wasm32-unknown-unknown - # - name: Install Rust - # run: | - # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - # source "$HOME/.cargo/env" - # rustup toolchain install nightly-2022-10-09 - # rustup default nightly - # rustup target add wasm32-unknown-unknown --toolchain nightly - # export PATH="$HOME/.cargo/bin:$PATH" + - name: Check TOML + uses: dprint/check@v2.2 - # - name: Check TOML - # uses: dprint/check@v2.2 + - name: Check Format + run: | + cargo fmt -- --check - # - name: Check Format - # run: | - # cargo fmt -- --check + - name: Rust Cache + uses: Swatinem/rust-cache@v2 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - - # - name: Check with Clippy - # run: | - # cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings + - name: Check with Clippy + run: | + cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings - name: Run cargo-tarpaulin uses: actions-rs/tarpaulin@v0.1 @@ -63,14 +54,14 @@ jobs: version: '0.22.0' args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' - # - name: Check Build - # run: | - # SKIP_WASM_BUILD=1 cargo check --release + - name: Check Build + run: | + SKIP_WASM_BUILD=1 cargo check --release - # - name: Check Build for Benchmarking - # run: > - # pushd node && - # cargo check --features=runtime-benchmarks --release + - name: Check Build for Benchmarking + run: > + pushd node && + cargo check --features=runtime-benchmarks --release - name: Upload coverage report uses: actions/upload-artifact@v3