Skip to content

Commit

Permalink
integrated teerdays and ran benchmarks for own pallets only
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Jul 19, 2024
1 parent f5a4fd0 commit f558539
Show file tree
Hide file tree
Showing 15 changed files with 418 additions and 201 deletions.
39 changes: 39 additions & 0 deletions .cargo/zepter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version:
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: 0.13.2

# The examples in this file assume crate `A` to have a dependency on crate `B`.
workflows:
check:
- [
'lint',
# Check that `A` activates the features of `B`.
'propagate-feature',
# These are the features to check:
'--features=try-runtime,runtime-benchmarks,std',
# 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',
# Auxillary flags:
'--offline',
'--locked',
'--show-path',
'--quiet',
]
# Same as `check`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]

# Will be displayed when any workflow fails:
help:
text: |
This repo uses the Zepter CLI to detect abnormalities in the feature configuration.
It looks like one more more checks failed; please check the console output. You can try to automatically address them by running `zepter`.
Otherwise please ask directly in the Merge Request, GitHub Discussions or on Matrix Chat, thank you.
links:
- "https://github.com/ggwpez/zepter"
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,28 @@ jobs:
- name: ${{ matrix.check }}
run: cargo ${{ matrix.check }}

cargo-zepter:
name: Cargo Zepter
runs-on: ubuntu-latest

steps:
- name: Install stable Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

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

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Don't clone historic commits.

- name: Check features
run: zepter run check

license-check:
runs-on: ubuntu-latest
steps:
Expand Down
57 changes: 41 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 15 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,21 @@ substrate-frame-rpc-system = { version = "35.0.0" }
substrate-wasm-builder = "23.0.0"
substrate-build-script-utils = "11.0.0"

#[patch."https://github.com/integritee-network/pallets.git"]
#pallet-claims = { path = '../pallets/claims' }
#pallet-enclave-bridge = { path = '../pallets/enclave-bridge' }
#pallet-teerex = { path = '../pallets/teerex' }
#pallet-sidechain = { path = '../pallets/sidechain' }
#sgx-verify = { path = '../pallets/teerex/sgx-verify' }
#pallet-teeracle = { path = '../pallets/teeracle' }
#test-utils = { path = '../pallets/test-utils' }
#claims-primitives = { path = '../pallets/primitives/claims' }
#enclave-bridge-primitives = { path = '../pallets/primitives/enclave-bridge' }
#teerex-primitives = { path = '../pallets/primitives/teerex' }
#teeracle-primitives = { path = '../pallets/primitives/teeracle' }
#common-primitives = { path = '../pallets/primitives/common' }
[patch."https://github.com/integritee-network/pallets.git"]
claims-primitives = { path = '../pallets/primitives/claims' }
common-primitives = { path = '../pallets/primitives/common' }
enclave-bridge-primitives = { path = '../pallets/primitives/enclave-bridge' }
pallet-claims = { path = '../pallets/claims' }
pallet-enclave-bridge = { path = '../pallets/enclave-bridge' }
pallet-sidechain = { path = '../pallets/sidechain' }
pallet-teeracle = { path = '../pallets/teeracle' }
pallet-teerdays = { path = '../pallets/teerdays' }
pallet-teerex = { path = '../pallets/teerex' }
sgx-verify = { path = '../pallets/teerex/sgx-verify' }
teeracle-primitives = { path = '../pallets/primitives/teeracle' }
teerdays-primitives = { path = '../pallets/primitives/teerdays' }
teerex-primitives = { path = '../pallets/primitives/teerex' }
test-utils = { path = '../pallets/test-utils' }

[patch.crates-io]
ring = { git = "https://github.com/betrusted-io/ring-xous", branch = "0.16.20-cleanup" }
2 changes: 2 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ runtime-benchmarks = [
"sc-service/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
# for secure launch of a live solo network, do enable extrinsic filtering
extrinsic-filtering = ["integritee-node-runtime/extrinsic-filtering"]
11 changes: 10 additions & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pallet-claims = { workspace = true }
pallet-enclave-bridge = { workspace = true }
pallet-sidechain = { workspace = true }
pallet-teeracle = { workspace = true }
pallet-teerdays = { workspace = true }
pallet-teerex = { workspace = true }

sp-api = { workspace = true }
Expand Down Expand Up @@ -115,14 +116,18 @@ std = [
"pallet-proxy/std",
"pallet-utility/std",
"pallet-teeracle/std",
"pallet-teerdays/std",
"frame-benchmarking?/std",
"frame-system-benchmarking?/std",
"pallet-preimage/std",
"sp-staking/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"hex-literal",
"sp-runtime/runtime-benchmarks",
# actual pallets to be benchmarked
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-grandpa/frame-benchmarking",
Expand All @@ -139,4 +144,8 @@ runtime-benchmarks = [
"pallet-utility/runtime-benchmarks",
"pallet-teeracle/runtime-benchmarks",
"pallet-sidechain/runtime-benchmarks",
"pallet-teerdays/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
]
Loading

0 comments on commit f558539

Please sign in to comment.