Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into snowbridge
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/scripts/check-workspace.py
#	.github/scripts/common/lib.sh
#	.github/workflows/check-licenses.yml
#	.github/workflows/check-prdoc.yml
#	.github/workflows/release-50_publish-docker.yml
#	.github/workflows/release-99_notif-published.yml
#	Cargo.lock
#	bridges/snowbridge/pallets/ethereum-client/Cargo.toml
#	bridges/snowbridge/pallets/ethereum-client/src/tests.rs
#	bridges/snowbridge/pallets/inbound-queue/Cargo.toml
#	bridges/snowbridge/pallets/inbound-queue/src/mock.rs
#	bridges/snowbridge/pallets/outbound-queue/Cargo.toml
#	bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
#	bridges/snowbridge/pallets/outbound-queue/runtime-api/Cargo.toml
#	bridges/snowbridge/pallets/outbound-queue/src/lib.rs
#	bridges/snowbridge/pallets/system/Cargo.toml
#	bridges/snowbridge/pallets/system/runtime-api/Cargo.toml
#	bridges/snowbridge/primitives/beacon/Cargo.toml
#	bridges/snowbridge/primitives/core/Cargo.toml
#	bridges/snowbridge/primitives/ethereum/Cargo.toml
#	bridges/snowbridge/runtime/runtime-common/Cargo.toml
#	bridges/snowbridge/runtime/test-common/Cargo.toml
  • Loading branch information
claravanstaden authored and claravanstaden committed Mar 25, 2024
2 parents 5da7df7 + 463ccb8 commit 9293295
Show file tree
Hide file tree
Showing 1,251 changed files with 43,428 additions and 21,684 deletions.
71 changes: 71 additions & 0 deletions .github/scripts/check-prdoc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env python3

'''
Ensure that the prdoc files are valid.
# Example
```sh
python3 -m pip install cargo-workspace
python3 .github/scripts/check-prdoc.py Cargo.toml prdoc/*.prdoc
```
Produces example output:
```pre
🔎 Reading workspace polkadot-sdk/Cargo.toml
📦 Checking 32 prdocs against 493 crates.
✅ All prdocs are valid
```
'''

import os
import yaml
import argparse
import cargo_workspace

def check_prdoc_crate_names(root, paths):
'''
Check that all crates of the `crates` section of each prdoc is present in the workspace.
'''

print(f'🔎 Reading workspace {root}.')
workspace = cargo_workspace.Workspace.from_path(root)
crate_names = [crate.name for crate in workspace.crates]

print(f'📦 Checking {len(paths)} prdocs against {len(crate_names)} crates.')
faulty = {}

for path in paths:
with open(path, 'r') as f:
prdoc = yaml.safe_load(f)

for crate in prdoc.get('crates', []):
crate = crate['name']
if crate in crate_names:
continue

faulty.setdefault(path, []).append(crate)

if len(faulty) == 0:
print('✅ All prdocs are valid.')
else:
print('❌ Some prdocs are invalid.')
for path, crates in faulty.items():
print(f'💥 {path} lists invalid crate: {", ".join(crates)}')
exit(1)

def parse_args():
parser = argparse.ArgumentParser(description='Check prdoc files')
parser.add_argument('root', help='The cargo workspace manifest', metavar='root', type=str, nargs=1)
parser.add_argument('prdoc', help='The prdoc files', metavar='prdoc', type=str, nargs='*')
args = parser.parse_args()

if len(args.prdoc) == 0:
print('❌ Need at least one prdoc file as argument.')
exit(1)

return { 'root': os.path.abspath(args.root[0]), 'prdocs': args.prdoc }

if __name__ == '__main__':
args = parse_args()
check_prdoc_crate_names(args['root'], args['prdocs'])
4 changes: 2 additions & 2 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ build-rustdoc:
- .run-immediately
variables:
SKIP_WASM_BUILD: 1
RUSTDOCFLAGS: ""
RUSTDOCFLAGS: "--default-theme=ayu --html-in-header ./docs/sdk/headers/header.html --extend-css ./docs/sdk/headers/theme.css"
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
Expand Down Expand Up @@ -337,7 +337,7 @@ build-runtimes-polkavm:
- .common-refs
- .run-immediately
script:
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p minimal-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p minimal-template-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p westend-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p rococo-runtime
- SUBSTRATE_RUNTIME_TARGET=riscv cargo check -p polkadot-test-runtime
Expand Down
20 changes: 19 additions & 1 deletion .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ check-toml-format:
export RUST_LOG=remote-ext=debug,runtime=debug
echo "---------- Downloading try-runtime CLI ----------"
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.4/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
echo "Using try-runtime-cli version:"
./try-runtime --version
echo "---------- Building ${PACKAGE} runtime ----------"
time cargo build --release --locked -p "$PACKAGE" --features try-runtime
Expand Down Expand Up @@ -257,3 +259,19 @@ find-fail-ci-phrase:
echo "No $ASSERT_REGEX was found, exiting with 0";
exit 0;
fi

check-core-crypto-features:
stage: check
extends:
- .docker-env
- .common-refs
script:
- pushd substrate/primitives/core
- ./check-features-variants.sh
- popd
- pushd substrate/primitives/application-crypto
- ./check-features-variants.sh
- popd
- pushd substrate/primitives/keyring
- ./check-features-variants.sh
- popd
16 changes: 15 additions & 1 deletion .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ test-linux-stable:
# "upgrade_version_checks_should_work" is currently failing
- |
time cargo nextest run \
--filter-expr 'not deps(/polkadot-subsystem-bench/)' \
--workspace \
--locked \
--release \
Expand All @@ -48,6 +49,7 @@ test-linux-stable:
- target/nextest/default/junit.xml
reports:
junit: target/nextest/default/junit.xml
timeout: 90m

test-linux-oldkernel-stable:
extends: test-linux-stable
Expand All @@ -68,7 +70,7 @@ test-linux-stable-runtime-benchmarks:
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet
- time cargo nextest run --filter-expr 'not deps(/polkadot-subsystem-bench/)' --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet

# can be used to run all tests
# test-linux-stable-all:
Expand Down Expand Up @@ -492,3 +494,15 @@ test-syscalls:
printf "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update polkadot/scripts/list-syscalls/*-worker-syscalls as needed.\n";
fi
allow_failure: false # this rarely triggers in practice

subsystem-regression-tests:
stage: test
extends:
- .docker-env
- .common-refs
- .run-immediately
script:
- cargo bench --profile=testnet -p polkadot-availability-recovery --bench availability-recovery-regression-bench --features subsystem-benchmarks
tags:
- benchmark
allow_failure: true
2 changes: 1 addition & 1 deletion .gitlab/pipeline/zombienet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.zombienet-refs:
extends: .build-refs
variables:
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.91"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.95"

include:
# substrate tests
Expand Down
8 changes: 8 additions & 0 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ zombienet-polkadot-functional-0011-async-backing-6-seconds-rate:
--local-dir="${LOCAL_DIR}/functional"
--test="0011-async-backing-6-seconds-rate.zndsl"

zombienet-polkadot-functional-0012-elastic-scaling-mvp:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0012-elastic-scaling-mvp.zndsl"

zombienet-polkadot-smoke-0001-parachains-smoke-test:
extends:
- .zombienet-polkadot-common
Expand Down
Loading

0 comments on commit 9293295

Please sign in to comment.