-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ao-statement-distribution-reenabling-prep
* master: (93 commits) Fix broken windows build (#4636) Beefy client generic on aduthority Id (#1816) pallet-staking: Put tests behind `cfg(debug_assertions)` (#4620) Broker new price adapter (#4521) Change `XcmDryRunApi::dry_run_extrinsic` to take a call instead (#4621) Update README.md (#4623) Publish `chain-spec-builder` (#4518) Add omni bencher & chain-spec-builder bins to release (#4557) Moves runtime macro out of experimental flag (#4249) Filter workspace dependencies in the templates (#4599) parachain-inherent: Make `para_id` more prominent (#4555) Add metric to measure the time it takes to gather enough assignments (#4587) Improve On_demand_assigner events (#4339) Conditional `required` checks (#4544) [CI] Deny adding git deps (#4572) [subsytem-bench] Remove redundant banchmark_name param (#4540) Add availability-recovery from systematic chunks (#1644) Remove workspace lints from templates (#4598) `sc-chain-spec`: deprecated code removed (#4410) [subsystem-benchmarks] Add statement-distribution benchmarks (#3863) ...
- Loading branch information
Showing
1,015 changed files
with
33,134 additions
and
12,379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
Script to deny Git dependencies in the Cargo workspace. Can be passed one optional argument for the | ||
root folder. If not provided, it will use the cwd. | ||
## Usage | ||
python3 .github/scripts/deny-git-deps.py polkadot-sdk | ||
""" | ||
|
||
import os | ||
import sys | ||
|
||
from cargo_workspace import Workspace, DependencyLocation | ||
|
||
KNOWN_BAD_GIT_DEPS = { | ||
'simple-mermaid': ['xcm-docs'], | ||
# Fix in <https://github.com/paritytech/polkadot-sdk/issues/2922> | ||
'bandersnatch_vrfs': ['sp-core'], | ||
} | ||
|
||
root = sys.argv[1] if len(sys.argv) > 1 else os.getcwd() | ||
workspace = Workspace.from_path(root) | ||
|
||
def check_dep(dep, used_by): | ||
if dep.location != DependencyLocation.GIT: | ||
return | ||
|
||
if used_by in KNOWN_BAD_GIT_DEPS.get(dep.name, []): | ||
print(f'🤨 Ignoring git dependency {dep.name} in {used_by}') | ||
else: | ||
print(f'🚫 Found git dependency {dep.name} in {used_by}') | ||
sys.exit(1) | ||
|
||
# Check the workspace dependencies that can be inherited: | ||
for dep in workspace.dependencies: | ||
check_dep(dep, "workspace") | ||
|
||
# And the dependencies of each crate: | ||
for crate in workspace.crates: | ||
for dep in crate.dependencies: | ||
check_dep(dep, crate.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Reusable workflow to perform checks and generate conditions for other workflows. | ||
# Currently it checks if any Rust (build-related) file is changed | ||
# and if the current (caller) workflow file is changed. | ||
# Example: | ||
# | ||
# jobs: | ||
# changes: | ||
# permissions: | ||
# pull-requests: read | ||
# uses: ./.github/workflows/check-changed-files.yml | ||
# some-job: | ||
# needs: changes | ||
# if: ${{ needs.changes.outputs.rust }} | ||
# ....... | ||
|
||
name: Check changes files | ||
|
||
on: | ||
workflow_call: | ||
# Map the workflow outputs to job outputs | ||
outputs: | ||
rust: | ||
value: ${{ jobs.changes.outputs.rust }} | ||
description: 'true if any of the build-related OR current (caller) workflow files have changed' | ||
current-workflow: | ||
value: ${{ jobs.changes.outputs.current-workflow }} | ||
description: 'true if current (caller) workflow file has changed' | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
# true if current workflow (caller) file is changed | ||
rust: ${{ steps.filter.outputs.rust == 'true' || steps.filter.outputs.current-workflow == 'true' }} | ||
current-workflow: ${{ steps.filter.outputs.current-workflow }} | ||
steps: | ||
- id: current-file | ||
run: echo "current-workflow-file=$(echo ${{ github.workflow_ref }} | sed -nE "s/.*(\.github\/workflows\/[a-zA-Z0-9_-]*\.y[a]?ml)@refs.*/\1/p")" >> $GITHUB_OUTPUT | ||
- run: echo "${{ steps.current-file.outputs.current-workflow-file }}" | ||
# For pull requests it's not necessary to checkout the code | ||
- id: filter | ||
uses: dorny/paths-filter@v3 | ||
with: | ||
predicate-quantifier: 'every' | ||
# current-workflow - check if the current (caller) workflow file is changed | ||
# rust - check if any Rust (build-related) file is changed | ||
filters: | | ||
current-workflow: | ||
- '${{ steps.current-file.outputs.current-workflow-file }}' | ||
rust: | ||
- '**/*' | ||
- '!.github/**/*' | ||
- '!prdoc/**/*' | ||
- '!docs/**/*' | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
# Checks that doesn't require heavy lifting, like formatting, linting, etc. | ||
name: quick-checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
merge_group: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
set-image: | ||
# GitHub Actions allows using 'env' in a container context. | ||
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 | ||
# This workaround sets the container image for each job using 'set-image' job output. | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
outputs: | ||
IMAGE: ${{ steps.set_image.outputs.IMAGE }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: set_image | ||
run: cat .github/env >> $GITHUB_OUTPUT | ||
fmt: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Cargo fmt | ||
run: cargo +nightly fmt --all -- --check | ||
check-dependency-rules: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: check dependency rules | ||
run: | | ||
cd substrate/ | ||
../.gitlab/ensure-deps.sh | ||
check-rust-feature-propagation: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: run zepter | ||
run: zepter run check | ||
test-rust-features: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: run rust features | ||
run: bash .gitlab/rust-features.sh . | ||
check-toml-format: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: check toml format | ||
run: | | ||
taplo format --check --config .config/taplo.toml | ||
echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues" | ||
check-workspace: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023) | ||
- name: install python deps | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y python3-pip python3 | ||
pip3 install toml "cargo-workspace>=1.2.6" | ||
- name: check integrity | ||
run: > | ||
python3 .github/scripts/check-workspace.py . | ||
--exclude | ||
"substrate/frame/contracts/fixtures/build" | ||
"substrate/frame/contracts/fixtures/contracts/common" | ||
- name: deny git deps | ||
run: python3 .github/scripts/deny-git-deps.py . | ||
check-markdown: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://npm.pkg.github.com" | ||
scope: "@paritytech" | ||
- name: Install tooling | ||
run: | | ||
npm install -g markdownlint-cli | ||
markdownlint --version | ||
- name: Check Markdown | ||
env: | ||
CONFIG: .github/.markdownlint.yaml | ||
run: | | ||
echo "Checking markdown formatting. More info: docs/contributor/markdown_linting.md" | ||
markdownlint --config "$CONFIG" --ignore target . | ||
check-umbrella: | ||
runs-on: arc-runners-polkadot-sdk | ||
timeout-minutes: 10 | ||
needs: [set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023) | ||
- name: install python deps | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y python3-pip python3 | ||
pip3 install "cargo-workspace>=1.2.4" toml | ||
- name: check umbrella correctness | ||
run: | | ||
python3 scripts/generate-umbrella.py --sdk . --version 0.1.0 | ||
cargo +nightly fmt --all | ||
if [ -n "$(git status --porcelain)" ]; then | ||
cat <<EOF | ||
👋 Hello developer! The SemVer information that you declared in the prdoc file did not match what the CI detected. | ||
Please check the output above and see the following links for more help: | ||
- https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/prdoc.md#record-semver-changes | ||
- https://forum.polkadot.network/t/psa-polkadot-sdk-to-use-semver | ||
Otherwise feel free to ask in the Merge Request or in Matrix chat. | ||
EOF | ||
git diff | ||
exit 1 | ||
fi |
Oops, something went wrong.