Skip to content

Commit

Permalink
Zepter integration (#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Jun 24, 2024
1 parent bc238dd commit e2d0aae
Show file tree
Hide file tree
Showing 39 changed files with 489 additions and 23 deletions.
46 changes: 46 additions & 0 deletions .config/zepter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Configuration for the Zepter CLI to ensure correct feature configuration in the Rust workspace.
# <https://crates.io/crates/zepter>

version:
# File format for parsing it:
format: 1
# Minimum version of the binary that is expected to work. This is just for printing a nice error
# message when someone tries to use an older version.
binary: 1.5.0

# The examples in this file assume crate `A` to have a dependency on crate `B`.
workflows:
# Check that everything is good without modifying anything:
check:
- [
'lint',
# Check that `A` activates the features of `B`.
'propagate-feature',
# These are the features to check:
'--features=try-runtime,runtime-benchmarks,evm-tracing,std',
# Ignore the features of dependencies that are exclusively used as dev or build.
'--dep-kinds=normal:check,dev:ignore,build:ignore',
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually.
'--left-side-feature-missing=ignore',
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.
'--left-side-outside-workspace=ignore',
# Some features imply that they activate a specific dependency as non-optional. Otherwise the default behaviour with a `?` is used.
'--feature-enables-dep=try-runtime:frame-try-runtime,runtime-benchmarks:frame-benchmarking',
# Show the paths of failed crates to have them clickable in the terminal: 
'--show-path',
# Aux
'--offline',
'--locked',
'--quiet',
]
# Same as `check`, but actually fix the issues instead of just reporting them:
default:
- [ $check.0, '--fix' ]

# Will be displayed when any workflow fails:
help:
text: |
Astar uses the Zepter CLI to detect abnormalities in the feature configuration.
It looks like at least one check failed; please see the console output. You can try to automatically address them by running `zepter`.
links:
- "https://github.com/ggwpez/zepter"
36 changes: 36 additions & 0 deletions .github/workflows/zepter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Zepter

on:
pull_request:
branches:
- master
paths-ignore:
- '**/README.md'
push:
branches:
- master
paths-ignore:
- '**/README.md'

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

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4

- name: Install deps
run: sudo apt -y install protobuf-compiler

- name: Install & display rust toolchain
run: rustup show

- name: Install Zepter
run: cargo install zepter -f --locked && zepter --version

- name: Check Rust features
run: zepter run check
38 changes: 34 additions & 4 deletions bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,46 @@ runtime-benchmarks = [
"sp-keyring",
"polkadot-runtime-common",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli?/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-ethereum/runtime-benchmarks",
"pallet-evm/runtime-benchmarks",
"polkadot-parachain/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-runtime-common?/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"sc-client-db/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
cli = ["try-runtime-cli"]
try-runtime = ["local-runtime/try-runtime", "try-runtime-cli/try-runtime"]
try-runtime = [
"local-runtime/try-runtime",
"try-runtime-cli/try-runtime",
"astar-primitives/try-runtime",
"astar-runtime/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime/try-runtime",
"pallet-ethereum/try-runtime",
"pallet-evm/try-runtime",
"pallet-transaction-payment/try-runtime",
"polkadot-cli?/try-runtime",
"polkadot-runtime-common?/try-runtime",
"polkadot-service/try-runtime",
"shibuya-runtime/try-runtime",
"shiden-runtime/try-runtime",
"sp-runtime/try-runtime",
]
evm-tracing = [
"moonbeam-rpc-debug",
"moonbeam-rpc-primitives-debug",
"moonbeam-rpc-primitives-txpool",
"moonbeam-rpc-trace",
"moonbeam-rpc-txpool",
"shibuya-runtime/evm-tracing",
"shiden-runtime/evm-tracing",
"astar-runtime/evm-tracing",
"local-runtime/evm-tracing",
]
manual-seal = [
"sc-consensus-manual-seal",
]
manual-seal = ["sc-consensus-manual-seal"]
17 changes: 15 additions & 2 deletions chain-extensions/pallet-assets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ std = [
"pallet-assets/std",
"assets-chain-extension-types/std",
"pallet-balances/std",
"log/std",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-assets/try-runtime",
"pallet-contracts/try-runtime",
"sp-runtime/try-runtime",
]
runtime-benchmarks = [
"pallet-assets/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
runtime-benchmarks = ["pallet-assets/runtime-benchmarks"]
1 change: 1 addition & 0 deletions chain-extensions/unified-accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ std = [
"astar-primitives/std",
"pallet-unified-accounts/std",
"unified-accounts-chain-extension-types/std",
"log/std",
]
2 changes: 2 additions & 0 deletions chain-extensions/xvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ std = [
"sp-runtime/std",
# Astar
"astar-primitives/std",
"log/std",
"xvm-chain-extension-types/std",
]
14 changes: 13 additions & 1 deletion pallets/astar-xcm-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,18 @@ std = [
"sp-std/std",
"sp-runtime/std",
"xcm/std",
"log/std",
"scale-info/std",
"serde?/std",
"xcm-executor/std",
]

try-runtime = ["frame-support/try-runtime"]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]

runtime-benchmarks = [
"frame-benchmarking",
Expand All @@ -64,4 +73,7 @@ runtime-benchmarks = [
"pallet-xcm-benchmarks/runtime-benchmarks",
"parity-scale-codec",
"xcm-executor/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
12 changes: 11 additions & 1 deletion pallets/collator-selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
]
std = [
"parity-scale-codec/std",
Expand All @@ -60,6 +63,13 @@ std = [
"pallet-session/std",
"pallet-aura/std",
"pallet-balances/std",
"serde/std",
]

try-runtime = ["frame-support/try-runtime"]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-authorship/try-runtime",
"pallet-session/try-runtime",
"sp-runtime/try-runtime",
]
10 changes: 9 additions & 1 deletion pallets/dapp-staking-migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ std = [
"astar-primitives/std",
"sp-core/std",
"pallet-balances/std",
"sp-runtime/std",
]
runtime-benchmarks = [
"frame-benchmarking",
Expand All @@ -50,5 +51,12 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"pallet-dapp-staking-v3/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"pallet-dapp-staking-v3/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = ["frame-support/try-runtime"]
8 changes: 7 additions & 1 deletion pallets/dapp-staking-v3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,11 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"assert_matches",
"frame-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = ["frame-support/try-runtime"]
2 changes: 2 additions & 0 deletions pallets/dynamic-evm-base-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-transaction-payment/try-runtime",
"sp-runtime/try-runtime",
]
11 changes: 10 additions & 1 deletion pallets/ethereum-checked/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ std = [
"pallet-evm/std",
"pallet-ethereum/std",
"astar-primitives/std",
"frame-benchmarking?/std",
]
runtime-benchmarks = [
"hex",
Expand All @@ -64,5 +65,13 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"pallet-ethereum/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"pallet-evm/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"pallet-evm/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = ["frame-support/try-runtime"]
10 changes: 9 additions & 1 deletion pallets/inflation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@ std = [
"frame-system/std",
"pallet-balances/std",
"astar-primitives/std",
"frame-benchmarking?/std",
"sp-runtime/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = ["frame-support/try-runtime"]
11 changes: 10 additions & 1 deletion pallets/oracle-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,21 @@ std = [
"sp-arithmetic/std",
"orml-traits/std",
"orml-oracle/std",
"frame-benchmarking?/std",
"sp-runtime/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"orml-oracle/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = ["frame-support/try-runtime"]
10 changes: 9 additions & 1 deletion pallets/price-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,20 @@ std = [
"astar-primitives/std",
"sp-arithmetic/std",
"orml-traits/std",
"frame-benchmarking?/std",
"sp-runtime/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = ["frame-support/try-runtime"]
10 changes: 9 additions & 1 deletion pallets/static-price-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ std = [
"pallet-balances/std",
"astar-primitives/std",
"sp-arithmetic/std",
"frame-benchmarking?/std",
"sp-runtime/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"astar-primitives/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = ["frame-support/try-runtime"]
Loading

0 comments on commit e2d0aae

Please sign in to comment.