Skip to content

Commit

Permalink
Master.into()
Browse files Browse the repository at this point in the history
  • Loading branch information
kianenigma committed Nov 1, 2023
2 parents 198156b + f50054c commit 4dd8f40
Show file tree
Hide file tree
Showing 775 changed files with 30,387 additions and 9,598 deletions.
45 changes: 45 additions & 0 deletions .config/zepter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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',
# Enabling this feature somehow pulls in two versions of `sp-runtime-interface` and makes it impossible to build that crate with `cargo b -p sp-runtime-interface`. We therefore disable it for now.
'--ignore-missing-propagate=sp-core/std:bandersnatch_vrfs/std',
# 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',
# Actually modify the files and not just report the issues:
'--offline',
'--locked',
'--show-path',
'--quiet',
]
# Format the features into canonical format:
- ['format', 'features', '--offline', '--locked', '--quiet']
# Same as `check`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]
- [ $check.1, '--fix' ]

# Will be displayed when any workflow fails:
help:
text: |
Polkadot-SDK 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/paritytech/polkadot-sdk/issues/1831"
- "https://github.com/ggwpez/zepter"
69 changes: 69 additions & 0 deletions .github/workflows/build-and-attach-release-runtimes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build and Attach Runtimes to Releases/RC

on:
release:
types:
- created

env:
PROFILE: production

jobs:
build_and_upload:
strategy:
matrix:
runtime:
- { name: westend, package: westend-runtime, path: polkadot/runtime/westend }
- { name: rococo, package: rococo-runtime, path: polkadot/runtime/rococo }
- { name: asset-hub-rococo, package: asset-hub-rococo-runtime, path: cumulus/parachains/runtimes/assets/asset-hub-rococo }
- { name: asset-hub-westend, package: asset-hub-westend-runtime, path: cumulus/parachains/runtimes/assets/asset-hub-westend }
- { name: bridge-hub-rococo, package: bridge-hub-rococo-runtime, path: cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo }
- { name: contracts-rococo, package: contracts-rococo-runtime, path: cumulus/parachains/runtimes/contracts/contracts-rococo }
build_config:
# Release build has logging disabled and no dev features
- { type: on-chain-release, opts: --features on-chain-release-build }
# Debug build has logging enabled and developer features
- { type: dev-debug-build, opts: --features try-runtime }

runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build ${{ matrix.runtime.name }} ${{ matrix.build_config.type }}
id: srtool_build
uses: chevdor/srtool-actions@v0.9.0
env:
BUILD_OPTS: ${{ matrix.build_config.opts }}
with:
chain: ${{ matrix.runtime.name }}
package: ${{ matrix.runtime.package }}
runtime_dir: ${{ matrix.runtime.path }}
profile: ${{ env.PROFILE }}

- name: Build Summary
run: |
echo "${{ steps.srtool_build.outputs.json }}" | jq . > ${{ matrix.runtime.name }}-srtool-digest.json
cat ${{ matrix.runtime.name }}-srtool-digest.json
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}"
- name: Set up paths and runtime names
id: setup
run: |
RUNTIME_BLOB_NAME=$(echo ${{ matrix.runtime.package }} | sed 's/-/_/g').compact.compressed.wasm
PREFIX=${{ matrix.build_config.type == 'dev-debug-build' && 'DEV_DEBUG_BUILD__' || '' }}
echo "RUNTIME_BLOB_NAME=$RUNTIME_BLOB_NAME" >> $GITHUB_ENV
echo "ASSET_PATH=./${{ matrix.runtime.path }}/target/srtool/${{ env.PROFILE }}/wbuild/${{ matrix.runtime.package }}/$RUNTIME_BLOB_NAME" >> $GITHUB_ENV
echo "ASSET_NAME=$PREFIX$RUNTIME_BLOB_NAME" >> $GITHUB_ENV
- name: Upload Runtime to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET_PATH }}
asset_name: ${{ env.ASSET_NAME }}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-node@v3.8.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@v4.0.0
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
scope: "@paritytech"

- name: Check the licenses in Polkadot
run: |
shopt -s globstar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# This should restore from the most recent one:
restore-keys: cache-lychee-

- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 (22. Sep 2023)
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023)

- name: Lychee link checker
uses: lycheeverse/lychee-action@2ac9f030ccdea0033e2510a23a67da2a2da98492 # for v1.8.0 (15. May 2023)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-node@v3.8.1
- uses: actions/setup-node@v4.0.0
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [labeled, opened, synchronize, unlabeled]

env:
IMAGE: paritytech/prdoc:latest
IMAGE: paritytech/prdoc:v0.0.5
API_BASE: https://api.github.com/repos
REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Checkout repo
if: ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1

- name: PRdoc check for PR#${{ github.event.pull_request.number }}
if: ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/check-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check publish

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
check-publish:
strategy:
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Rust Cache
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
with:
cache-on-failure: true

- name: install parity-publish
run: cargo install parity-publish --profile dev

- name: parity-publish check
run: parity-publish check --allow-unpublished
4 changes: 2 additions & 2 deletions .github/workflows/fmt-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
container:
image: paritytech/ci-unified:bullseye-1.70.0-2023-05-23-v20230706
image: paritytech/ci-unified:bullseye-1.73.0-2023-11-01-v20231025
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Cargo fmt
run: cargo +nightly fmt --all -- --check
10 changes: 5 additions & 5 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

#TODO: this step will be needed when automated triggering will work
#this step runs only if the workflow is triggered automatically when new release is published
Expand Down Expand Up @@ -114,11 +114,11 @@ jobs:
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.image_type == 'rc' }}
runs-on: ubuntu-latest
needs: fetch-artifacts
environment: master
environment: release

steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Get artifacts from cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
Expand Down Expand Up @@ -238,10 +238,10 @@ jobs:
if: ${{ inputs.binary == 'polkadot' && inputs.image_type == 'release' }}
runs-on: ubuntu-latest
needs: fetch-latest-debian-package-version
environment: master
environment: release
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
Expand Down
35 changes: 18 additions & 17 deletions .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
name: Review PR
name: Review Bot
on:
pull_request_target:
workflow_run:
workflows:
- Review-Trigger
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:

permissions:
contents: read
- completed

jobs:
review-approvals:
runs-on: ubuntu-latest
environment: master
steps:
- name: Extract content of artifact
id: number
uses: Bullrich/extract-text-from-artifact@v1.0.0
with:
artifact-name: pr_number
- name: Generate token
id: team_token
id: app_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/review-bot@v2.0.1
uses: paritytech/review-bot@v2.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-token: ${{ steps.team_token.outputs.token }}
checks-token: ${{ steps.team_token.outputs.token }}
repo-token: ${{ steps.app_token.outputs.token }}
team-token: ${{ steps.app_token.outputs.token }}
checks-token: ${{ steps.app_token.outputs.token }}
pr-number: ${{ steps.number.outputs.content }}
request-reviewers: true
31 changes: 31 additions & 0 deletions .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Review-Trigger

on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:

jobs:
trigger-review-bot:
runs-on: ubuntu-latest
name: trigger review bot
steps:
- name: Get PR number
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "Saving PR number: $PR_NUMBER"
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
- uses: actions/upload-artifact@v3
name: Save PR number
with:
name: pr_number
path: pr/
retention-days: 5
5 changes: 3 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ workflow:
- if: $CI_COMMIT_BRANCH

variables:
CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
# CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
CI_IMAGE: "docker.io/paritytech/ci-unified:bullseye-1.73.0-2023-11-01-v20231025"
# BUILDAH_IMAGE is defined in group variables
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
RELENG_SCRIPTS_BRANCH: "master"
Expand All @@ -30,7 +31,7 @@ variables:
RUSTY_CACHIER_COMPRESSION_METHOD: zstd
NEXTEST_FAILURE_OUTPUT: immediate-final
NEXTEST_SUCCESS_OUTPUT: final
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.69"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.75"
DOCKER_IMAGES_VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"

default:
Expand Down
10 changes: 7 additions & 3 deletions .gitlab/check-each-crate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
crates = []
for line in output.splitlines():
if line != b"":
crates.append(line.decode('utf8').split(" ")[0])
line = line.decode('utf8').split(" ")
crate_name = line[0]
# The crate path is always the last element in the line.
crate_path = line[len(line) - 1].replace("(", "").replace(")", "")
crates.append((crate_name, crate_path))

# Make the list unique and sorted
crates = list(set(crates))
Expand Down Expand Up @@ -49,9 +53,9 @@
for i in range(0, crates_per_group + overflow_crates):
crate = crates_per_group * target_group + i

print(f"Checking {crates[crate]}", file=sys.stderr)
print(f"Checking {crates[crate][0]}", file=sys.stderr)

res = subprocess.run(["cargo", "check", "--locked", "-p", crates[crate]])
res = subprocess.run(["cargo", "check", "--locked"], cwd = crates[crate][1])

if res.returncode != 0:
sys.exit(1)
2 changes: 1 addition & 1 deletion .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ build-linux-substrate:
# see https://github.com/paritytech/ci_cd/issues/682#issuecomment-1340953589
- git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA"
script:
- WASM_BUILD_NO_COLOR=1 time cargo build --locked --release -p node-cli
- WASM_BUILD_NO_COLOR=1 time cargo build --locked --release -p staging-node-cli
- mv $CARGO_TARGET_DIR/release/substrate-node ./artifacts/substrate/substrate
- echo -n "Substrate version = "
- if [ "${CI_COMMIT_TAG}" ]; then
Expand Down
Loading

0 comments on commit 4dd8f40

Please sign in to comment.