-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bko-extended-ci-tests-pipeline
- Loading branch information
Showing
68 changed files
with
3,592 additions
and
2,041 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description="Process the CHANGELOG.md") | ||
parser.add_argument( | ||
"changelog", | ||
metavar="CHANGELOG", | ||
help="Path to the CHANGELOG.md file", | ||
default="CHANGELOG.md", | ||
nargs='?' | ||
) | ||
|
||
group = parser.add_mutually_exclusive_group() | ||
group.add_argument( | ||
"--print-latest-version", | ||
dest="print_latest_version", | ||
help="Print the latest version (first in the file) found in the CHANGELOG.md", | ||
action="store_true" | ||
) | ||
group.add_argument( | ||
"--should-release", | ||
dest="should_release", | ||
help="Should a release be made? Prints `1` or `0`.", | ||
action="store_true" | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
with open(args.changelog, "r") as changelog: | ||
lines = changelog.readlines() | ||
|
||
# Find the latest version | ||
for line in lines: | ||
if not line.startswith("## ["): | ||
continue | ||
|
||
version = line.strip().removeprefix("## [").split("]")[0] | ||
break | ||
|
||
if args.print_latest_version: | ||
print(version, end = "") | ||
sys.exit(0) | ||
elif args.should_release: | ||
if version.lower() == "unreleased": | ||
print("0", end = "") | ||
sys.exit(-1) | ||
elif version.count(".") != 2: | ||
print("0", end = "") | ||
sys.exit(-1) | ||
|
||
stream = os.popen("git tag -l v" + version) | ||
output = stream.read() | ||
|
||
# Empty output means that the tag doesn't exist and that we should release. | ||
if output.strip() == "": | ||
print("1", end = "") | ||
else: | ||
print("0", end = "") | ||
|
||
sys.exit(0) | ||
else: | ||
parser.print_help() |
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 @@ | ||
<!-- Remember that you can run `/merge` to enable auto-merge in the PR --> |
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,29 @@ | ||
name: Auto Merge Bot | ||
|
||
on: | ||
# GitHub considers PRs as issues | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
set-auto-merge: | ||
runs-on: ubuntu-latest | ||
environment: master | ||
# Important! This forces the job to run only on comments on Pull Requests that starts with '/merge' | ||
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/merge') }} | ||
steps: | ||
- name: Get the GitHub handle of the fellows | ||
uses: paritytech/[email protected] | ||
id: fellows | ||
- name: Generate token | ||
id: merge_token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ secrets.MERGE_APP_ID }} | ||
private_key: ${{ secrets.MERGE_APP_KEY }} | ||
- name: Set auto merge | ||
uses: paritytech/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ steps.merge_token.outputs.token }} | ||
MERGE_METHOD: "SQUASH" | ||
ALLOWLIST: ${{ steps.fellows.outputs.github-handles }} |
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,80 @@ | ||
name: Check Migrations | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
# Cancel a currently running workflow from the same PR, branch or tag when a new workflow is | ||
# triggered (ref https://stackoverflow.com/a/72408109) | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
runtime-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
runtime: ${{ steps.runtime.outputs.runtime }} | ||
name: Extract tasks from matrix | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: runtime | ||
run: | | ||
# Filter out runtimes that don't have a URI | ||
TASKS=$(jq '[.[] | select(.uri != null)]' .github/workflows/runtimes-matrix.json) | ||
SKIPPED_TASKS=$(jq '[.[] | select(.uri == null)]' .github/workflows/runtimes-matrix.json) | ||
echo --- Running the following tasks --- | ||
echo $TASKS | ||
echo --- Skipping the following tasks due to not having a uri field --- | ||
echo $SKIPPED_TASKS | ||
# Strip whitespace from Tasks now that we've logged it | ||
TASKS=$(echo $TASKS | jq -c .) | ||
echo "runtime=$TASKS" >> $GITHUB_OUTPUT | ||
check-migrations: | ||
needs: [runtime-matrix] | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download try-runtime-cli | ||
run: | | ||
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime | ||
chmod +x ./try-runtime | ||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
with: | ||
version: "3.6.1" | ||
|
||
- name: Add wasm32-unknown-unknown target | ||
run: rustup target add wasm32-unknown-unknown | ||
|
||
- name: Build ${{ matrix.runtime.name }} | ||
run: | | ||
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime | ||
- name: Check migrations | ||
run: | | ||
PACKAGE_NAME=${{ matrix.runtime.package }} | ||
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm | ||
# When running on relay, we don't need weight checks. | ||
NO_WEIGHT_WARNINGS_FLAG="" | ||
if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then | ||
NO_WEIGHT_WARNINGS_FLAG="--no-weight-warnings" | ||
fi | ||
# Disable idempotency checks for now because the Scheduler pallet MigrateToV1 migration is | ||
# non-idempotent at its root in Polkadot SDK V1.2.0. In V1.3.0 we can re-enable | ||
# idempotency checks. | ||
EXTRA_ARGS="--disable-spec-version-check --disable-idempotency-checks" | ||
./try-runtime \ | ||
--runtime ./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME \ | ||
on-runtime-upgrade --checks=pre-and-post $EXTRA_ARGS $NO_WEIGHT_WARNINGS_FLAG live --uri ${{ matrix.runtime.uri }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
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: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
checks: write | ||
|
||
jobs: | ||
review-approvals: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract content of artifact | ||
id: number | ||
uses: Bullrich/[email protected] | ||
with: | ||
artifact-name: pr_number | ||
- name: Generate token | ||
id: team_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.0 | ||
uses: paritytech/review-bot@v2.3.0 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
team-token: ${{ steps.team_token.outputs.token }} | ||
checks-token: ${{ steps.team_token.outputs.token }} | ||
pr-number: ${{ steps.number.outputs.content }} |
Oops, something went wrong.