From 05cfb02bec116349fe6e0428f06837a9290662ac Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Tue, 16 Jan 2024 20:47:35 +0800 Subject: [PATCH] CI check features (#1708) To resolve issue #1136. This is a cross verification against zepter. - [cargo-featalign](https://github.com/hack-ink/cargo-featalign): Verifies the proper propagation of all features. - [zepter](https://github.com/ggwpez/zepter): Checks for accidentally enabled features. cc @ggwpez --- Switch to a new branch. Original PR #1537. --------- Signed-off-by: Xavier Lau Signed-off-by: Oliver Tale-Yazdi Co-authored-by: Oliver Tale-Yazdi Co-authored-by: Chevdor --- .github/workflows/check-features.yml | 19 +++++++++++++++++++ substrate/frame/support/procedural/Cargo.toml | 4 ++-- substrate/primitives/api/Cargo.toml | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/check-features.yml diff --git a/.github/workflows/check-features.yml b/.github/workflows/check-features.yml new file mode 100644 index 000000000000..53d6ac6b4dbf --- /dev/null +++ b/.github/workflows/check-features.yml @@ -0,0 +1,19 @@ +name: Check Features + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + check-features: + runs-on: ubuntu-latest + steps: + - name: Fetch latest code + uses: actions/checkout@v4 + - name: Check + uses: hack-ink/cargo-featalign-action@bea88a864d6ca7d0c53c26f1391ce1d431dc7f34 # v0.1.1 + with: + crate: substrate/bin/node/runtime + features: std,runtime-benchmarks,try-runtime + ignore: sc-executor + default-std: true diff --git a/substrate/frame/support/procedural/Cargo.toml b/substrate/frame/support/procedural/Cargo.toml index 5e47f0dfeb0d..25debb7fc2bf 100644 --- a/substrate/frame/support/procedural/Cargo.toml +++ b/substrate/frame/support/procedural/Cargo.toml @@ -29,14 +29,14 @@ frame-support-procedural-tools = { path = "tools" } macro_magic = { version = "0.5.0", features = ["proc_support"] } proc-macro-warning = { version = "1.0.0", default-features = false } expander = "2.0.0" -sp-core-hashing = { path = "../../../primitives/core/hashing" } +sp-core-hashing = { path = "../../../primitives/core/hashing", default-features = false } [dev-dependencies] regex = "1" [features] default = ["std"] -std = [] +std = ["sp-core-hashing/std"] no-metadata-docs = [] # Generate impl-trait for tuples with the given number of tuples. Will be needed as the number of # pallets in a runtime grows. Does increase the compile time! diff --git a/substrate/primitives/api/Cargo.toml b/substrate/primitives/api/Cargo.toml index 345647cec25d..346b9c35fa8d 100644 --- a/substrate/primitives/api/Cargo.toml +++ b/substrate/primitives/api/Cargo.toml @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } -sp-api-proc-macro = { path = "proc-macro" } +sp-api-proc-macro = { path = "proc-macro", default-features = false } sp-core = { path = "../core", default-features = false } sp-std = { path = "../std", default-features = false } sp-runtime = { path = "../runtime", default-features = false }