Skip to content

Commit

Permalink
Merge branch 'master' into alexggh/fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexggh authored Jul 23, 2024
2 parents 7bfe535 + ac98bc3 commit 5d18a1d
Show file tree
Hide file tree
Showing 211 changed files with 5,904 additions and 1,105 deletions.
65 changes: 65 additions & 0 deletions .github/commands-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,36 @@ Each command will have the same two required values, but it could have more.

GitHub's official documentation: [Manually running a workflow](https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow)

#### Running from CLI

You can use [`gh cli`](https://cli.github.com/) to run the commands too. Refers to the [`gh workflow run`](https://cli.github.com/manual/gh_workflow_run) section from the documentation for more information.

### Number of the Pull Request

The number of the pull request. Required so the action can fetch the correct branch and comment if it fails.

## Action configurations

### FMT

For FMT you only need the PR number.

You can use the following [`gh cli`](https://cli.github.com/) inside the repo:

```bash
gh workflow run command-fmt.yml -f pr=1000
```

### Update UI

For Update UI you only need the PR number.

You can use the following [`gh cli`](https://cli.github.com/) inside the repo:

```bash
gh workflow run command-update-ui.yml -f pr=1000
```

### Bench

Runs `benchmark pallet` or `benchmark overhead` against your PR and commits back updated weights.
Expand Down Expand Up @@ -136,6 +160,12 @@ Posible combinations based on the `benchmark` dropdown.
- Requires `Runtime Dir` to be `testing`
- Requires `Target Directory` to be `cumulus`

You can use the following [`gh cli`](https://cli.github.com/) inside the repo:

```bash
gh workflow run command-bench.yml -f pr=1000 -f benchmark=polkadot-pallet -f subcommand=pallet -f runtime=rococo -f pallet=pallet_name -f target_dir=polkadot
```

### Bench-all

This is a wrapper to run `bench` for all pallets.
Expand Down Expand Up @@ -174,6 +204,12 @@ Posible combinations based on the `benchmark` dropdown.
- `people-westend`
- Requires `Target Directory` to be `cumulus`

You can use the following [`gh cli`](https://cli.github.com/) inside the repo:

```bash
gh workflow run command-bench-all.yml -f pr=1000 -f benchmark=pallet -f pallet=pallet_name -f target_dir=polkadot -f runtime=rococo
```

### Bench-overhead

Run benchmarks overhead and commit back results to PR.
Expand All @@ -193,6 +229,35 @@ Posible combinations based on the `benchmark` dropdown.
- `asset-hub-westend`
- Requires `Target directory` to be `cumulus`

You can use the following [`gh cli`](https://cli.github.com/) inside the repo:

```bash
gh workflow run command-bench-overheard.yml -f pr=1000 -f benchmark=substrate -f runtime=rococo -f target_dir=substrate
```

### Sync

Run sync and commit back results to PR.

Posible combinations based on the `benchmark` dropdown.

- `chain`
- Requires one of the following:
- `rococo`
- `westend`
- `sync-type`
- Requires one of the following:
- `warp`
- `full`
- `fast`
- `fast-unsafe`

You can use the following [`gh cli`](https://cli.github.com/) inside the repo:

```bash
gh workflow run command-sync.yml -f pr=1000 -f chain=rococo -f sync-type=full
```

## How to modify an action

If you want to modify an action and test it, you can do by simply pushing your changes and then selecting your branch in the `Use worflow from` option.
Expand Down
2 changes: 1 addition & 1 deletion .github/env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408"
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v202407161507"
13 changes: 13 additions & 0 deletions .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,16 @@ get_latest_release_tag() {
latest_release_tag=$(curl -s -H "$TOKEN" $api_base/paritytech/polkadot-sdk/releases/latest | jq -r '.tag_name')
printf $latest_release_tag
}

function get_polkadot_node_version_from_code() {
# list all the files with node version
git grep -e "\(NODE_VERSION[^=]*= \)\".*\"" |
# fetch only the one we need
grep "primitives/src/lib.rs:" |
# Print only the version
awk '{ print $7 }' |
# Remove the quotes
sed 's/"//g' |
# Remove the semicolon
sed 's/;//g'
}
2 changes: 1 addition & 1 deletion .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/[email protected].1
- uses: actions/[email protected].3
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
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 @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023)

- name: Lychee link checker
uses: lycheeverse/lychee-action@c3089c702fbb949e3f7a8122be0c33c017904f9b # for v1.9.1 (10. Jan 2024)
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # for v1.9.1 (10. Jan 2024)
with:
args: >-
--config .config/lychee.toml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- prdoc/*.prdoc
env:
TOOLCHAIN: nightly-2024-03-01
TOOLCHAIN: nightly-2024-06-01

jobs:
check-semver:
Expand All @@ -22,7 +22,7 @@ jobs:
cache-on-failure: true

- name: install parity-publish
run: cargo install parity-publish@0.6.0
run: cargo install parity-publish@0.7.0

- name: Rust compilation prerequisites
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks-quick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node.js
uses: actions/[email protected].1
uses: actions/[email protected].3
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/command-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
GH_TOKEN: ${{ github.token }}
- name: Run FMT
run: |
cargo --version
rustc --version
cargo +nightly --version
rustc +nightly --version
cargo +nightly fmt
# format toml.
# since paritytech/ci-unified:bullseye-1.73.0-2023-11-01-v20231204 includes taplo-cli
taplo format --config .config/taplo.toml
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/misc-sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ jobs:
"runtime",
]
resolver = "2"
[workspace.dependencies]
EOF
echo "$(toml get -r ./runtime/Cargo.toml 'package.name') = { path = \"./runtime\", default-features = false }" >> Cargo.toml
echo "$(toml get -r ./pallets/template/Cargo.toml 'package.name') = { path = \"./pallets/template\", default-features = false }" >> Cargo.toml
shell: bash
working-directory: polkadot-sdk/templates/${{ matrix.template }}/
- name: Update workspace configuration
Expand All @@ -116,9 +121,12 @@ jobs:
- name: Copy over the new changes
run: |
cp -r polkadot-sdk/templates/${{ matrix.template }}/* "${{ env.template-path }}/"
- name: Run psvm on monorepo workspace dependencies
run: psvm -o -v ${{ github.event.inputs.crate_release_version }} -p ./Cargo.toml
working-directory: polkadot-sdk/
- name: Copy over required workspace dependencies
run: |
echo -e "\n[workspace.dependencies]" >> Cargo.toml
set +e
# If a workspace dependency is required..
while cargo tree --depth 1 --prefix none --no-dedupe 2>&1 | grep 'was not found in `workspace.dependencies`'; do
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-check-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
cache-on-failure: true

- name: install parity-publish
run: cargo install parity-publish@0.6.0
run: cargo install parity-publish@0.7.0

- name: parity-publish check
run: parity-publish --color always check --allow-unpublished
2 changes: 1 addition & 1 deletion .github/workflows/publish-claim-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
cache-on-failure: true

- name: install parity-publish
run: cargo install parity-publish@0.6.0
run: cargo install parity-publish@0.7.0

- name: parity-publish claim
env:
Expand Down
78 changes: 21 additions & 57 deletions .github/workflows/release-10_rc-automation.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Release - RC automation
on:
push:
branches:
# Catches release-polkadot-v1.2.3, release-v1.2.3-rc1, etc
- release-v[0-9]+.[0-9]+.[0-9]+*
- release-cumulus-v[0-9]+*
- release-polkadot-v[0-9]+*
# TODO: Activate it and delete old branches patterns, when the release process from stable is setteled
#push:
# branches:
# # Catches release-polkadot-v1.2.3, release-v1.2.3-rc1, etc
# - release-v[0-9]+.[0-9]+.[0-9]+*
# - release-cumulus-v[0-9]+*
# - release-polkadot-v[0-9]+*
# - stable

workflow_dispatch:
inputs:
version:
description: Current release/rc version in format vX.X.X

jobs:
tag_rc:
Expand All @@ -25,28 +30,19 @@ jobs:
with:
fetch-depth: 0

- name: Get release product
id: get_rel_product
shell: bash
run: |
current_branch=$(git branch --show-current)
echo "Current branch: $current_branch"
if [[ "$current_branch" =~ "release-polkadot" ]]; then
echo "product=polkadot" >> $GITHUB_OUTPUT
elif [[ "$current_branch" =~ "release-cumulus" ]]; then
echo "product=polkadot-parachain" >> $GITHUB_OUTPUT
fi
- name: Compute next rc tag for polkadot
if: ${{ steps.get_rel_product.outputs.product == 'polkadot' }}
id: compute_tag_polkadot
- name: Compute next rc tag
# if: ${{ steps.get_rel_product.outputs.product == 'polkadot' }}
id: compute_tag
shell: bash
run: |
. ./.github/scripts/common/lib.sh
# Get last rc tag if exists, else set it to {version}-rc1
version=$(get_version_from_ghref ${GITHUB_REF})
if [[ -z "${{ inputs.version }}" ]]; then
version=v$(get_polkadot_node_version_from_code)
else
version=$(filter_version_from_input ${{ inputs.version }})
fi
echo "$version"
echo "version=$version" >> $GITHUB_OUTPUT
Expand All @@ -61,46 +57,14 @@ jobs:
echo "first_rc=true" >> $GITHUB_OUTPUT
fi
- name: Compute next rc tag for polkadot-parachain
if: ${{ steps.get_rel_product.outputs.product == 'polkadot-parachain' }}
id: compute_tag_cumulus
shell: bash
run: |
. ./.github/scripts/common/lib.sh
# Get last rc tag if exists, else set it to polkadot-parachains-{version}-rc1
version=$(get_version_from_ghref ${GITHUB_REF})
echo "$version"
echo "version=$version" >> $GITHUB_OUTPUT
last_rc=$(get_latest_rc_tag $version polkadot-parachain)
if [ -n "$last_rc" ]; then
suffix=$(increment_rc_tag $last_rc)
echo "new_tag=polkadot-parachains-$version-rc$suffix" >> $GITHUB_OUTPUT
echo "first_rc=false" >> $GITHUB_OUTPUT
else
echo "new_tag=polkadot-parachain-$version-rc1" >> $GITHUB_OUTPUT
echo "first_rc=true" >> $GITHUB_OUTPUT
fi
- name: Apply new tag
uses: tvdias/github-tagger@ed7350546e3e503b5e942dffd65bc8751a95e49d # v0.0.2
with:
# We can't use the normal GITHUB_TOKEN for the following reason:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
# RELEASE_BRANCH_TOKEN requires public_repo OAuth scope
repo-token: "${{ secrets.RELEASE_BRANCH_TOKEN }}"
tag: ${{ steps.compute_tag_polkadot.outputs.new_tag || steps.compute_tag_cumulus.outputs.new_tag }}

# - id: create-issue
# uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # v2.9.1
# # Only create the issue if it's the first release candidate
# if: steps.compute_tag.outputs.first_rc == 'true'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# VERSION: ${{ steps.compute_tag.outputs.version }}
# with:
# filename: .github/ISSUE_TEMPLATE/release.md
tag: ${{ steps.compute_tag.outputs.new_tag }}

- name: Send Matrix message to ${{ matrix.channel.name }}
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
Expand All @@ -110,4 +74,4 @@ jobs:
access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }}
server: m.parity.io
message: |
Release process for polkadot ${{ steps.compute_tag_polkadot.outputs.new_tag || steps.compute_tag_cumulus.outputs.new_tag }} has been started.<br/>
Release process for polkadot ${{ steps.compute_tag.outputs.new_tag }} has been started.<br/>
2 changes: 2 additions & 0 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ jobs:
release=$( echo $VERSION | cut -f1 -d- )
echo "tag=latest" >> $GITHUB_OUTPUT
echo "release=${release}" >> $GITHUB_OUTPUT
echo "stable=stable" >> $GITHUB_OUTPUT
- name: Build Injected Container image for polkadot rc or chain-spec-builder
if: ${{ env.BINARY == 'polkadot' || env.BINARY == 'chain-spec-builder' }}
Expand Down Expand Up @@ -294,6 +295,7 @@ jobs:
# TODO: The owner should be used below but buildx does not resolve the VARs
# TODO: It would be good to get rid of this GHA that we don't really need.
tags: |
parity/polkadot:stable
parity/polkadot:latest
parity/polkadot:${{ needs.fetch-latest-debian-package-version.outputs.polkadot_container_tag }}
build-args: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release-srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ env:
TOML_CLI_VERSION: 0.2.4

on:
push:
branches:
- release-v[0-9]+.[0-9]+.[0-9]+*
- release-cumulus-v[0-9]+*
- release-polkadot-v[0-9]+*
workflow_call:
inputs:
excluded_runtimes:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*.orig
*.rej
*.swp
*.wasm
**/._*
**/.criterion/
**/*.rs.bk
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 @@ -276,6 +276,14 @@ zombienet-polkadot-smoke-0004-coretime-smoke-test:
--local-dir="${LOCAL_DIR}/smoke"
--test="0004-coretime-smoke-test.zndsl"

zombienet-polkadot-smoke-0005-precompile-pvf-smoke:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/smoke"
--test="0005-precompile-pvf-smoke.zndsl"

zombienet-polkadot-misc-0001-parachains-paritydb:
extends:
- .zombienet-polkadot-common
Expand Down
Loading

0 comments on commit 5d18a1d

Please sign in to comment.