Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pallet-info-pub' into pallet-inf…
Browse files Browse the repository at this point in the history
…o-pub
  • Loading branch information
JuaniRios committed Jul 18, 2024
2 parents 4e0f01d + 70e7ac6 commit b793e17
Show file tree
Hide file tree
Showing 1,376 changed files with 25,997 additions and 14,724 deletions.
1 change: 1 addition & 0 deletions .github/commands-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The current available command actions are:

- [Command FMT](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-fmt.yml)
- [Command Update UI](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-update-ui.yml)
- [Command Sync](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-sync.yml)
- [Command Bench](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench.yml)
- [Command Bench All](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench-all.yml)
- [Command Bench Overhead](https://github.com/paritytech/polkadot-sdk/actions/workflows/command-bench-overhead.yml)
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-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
merge_group:

env:
IMAGE: docker.io/paritytech/prdoc:v0.0.7
IMAGE: docker.io/paritytech/prdoc:v0.0.8
API_BASE: https://api.github.com/repos
REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/check-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- prdoc/*.prdoc
env:
TOOLCHAIN: nightly-2024-03-01

jobs:
check-semver:
Expand All @@ -19,14 +21,14 @@ jobs:
with:
cache-on-failure: true

- name: install parity-publish
run: cargo install [email protected]

- name: Rust compilation prerequisites
run: |
rustup default nightly-2024-03-01
rustup target add wasm32-unknown-unknown --toolchain nightly-2024-03-01
rustup component add rust-src --toolchain nightly-2024-03-01
- name: install parity-publish
run: cargo install [email protected]
rustup default $TOOLCHAIN
rustup target add wasm32-unknown-unknown --toolchain $TOOLCHAIN
rustup component add rust-src --toolchain $TOOLCHAIN
- name: extra git setup
run: |
Expand All @@ -39,7 +41,7 @@ jobs:
export CARGO_TARGET_DIR=target
export RUSTFLAGS='-A warnings -A missing_docs'
export SKIP_WASM_BUILD=1
if ! parity-publish --color always prdoc --since old --validate prdoc/pr_$PR.prdoc --toolchain nightly-2024-03-01 -v; then
if ! parity-publish --color always prdoc --since old --validate prdoc/pr_$PR.prdoc -v --toolchain $TOOLCHAIN; then
cat <<EOF
👋 Hello developer! The SemVer information that you declared in the prdoc file did not match what the CI detected.
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/checks-quick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# 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
timeout-minutes: 20
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
Expand All @@ -30,7 +30,7 @@ jobs:
run: cat .github/env >> $GITHUB_OUTPUT
fmt:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
Expand All @@ -40,7 +40,7 @@ jobs:
run: cargo +nightly fmt --all -- --check
check-dependency-rules:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: check dependency rules
Expand All @@ -49,7 +49,7 @@ jobs:
../.gitlab/ensure-deps.sh
check-rust-feature-propagation:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
Expand All @@ -65,7 +65,7 @@ jobs:
time zepter run check
test-rust-features:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
Expand All @@ -75,7 +75,7 @@ jobs:
run: bash .gitlab/rust-features.sh .
check-toml-format:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
Expand All @@ -87,7 +87,7 @@ jobs:
echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues"
check-workspace:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023)
- name: install python deps
Expand All @@ -104,7 +104,7 @@ jobs:
run: python3 .github/scripts/deny-git-deps.py .
check-markdown:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -127,7 +127,7 @@ jobs:
markdownlint --config "$CONFIG" --ignore target .
check-umbrella:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/command-bench-all.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Command Bench All

on:
workflow_dispatch:
on:
workflow_dispatch:
inputs:
pr:
description: Number of the Pull Request
Expand Down Expand Up @@ -51,9 +51,8 @@ on:
- people-rococo
- people-westend


jobs:
set-image:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
Expand All @@ -64,9 +63,12 @@ jobs:
run: cat .github/env >> $GITHUB_OUTPUT
cmd-bench-all:
needs: [set-image]
runs-on: arc-runners-polkadot-sdk-benchmark
runs-on: arc-runners-polkadot-sdk-weights
container:
image: ${{ needs.set-image.outputs.IMAGE }}
permissions:
contents: write
pull-requests: write
steps:
- name: Download repo
uses: actions/checkout@v4
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/command-bench-overhead.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Command Bench Overhead

on:
workflow_dispatch:
on:
workflow_dispatch:
inputs:
pr:
description: Number of the Pull Request
Expand Down Expand Up @@ -31,7 +31,7 @@ on:
- cumulus

jobs:
set-image:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
Expand All @@ -45,6 +45,9 @@ jobs:
runs-on: arc-runners-polkadot-sdk-benchmark
container:
image: ${{ needs.set-image.outputs.IMAGE }}
permissions:
contents: write
pull-requests: write
steps:
- name: Download repo
uses: actions/checkout@v4
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/command-bench.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Command Bench

on:
workflow_dispatch:
on:
workflow_dispatch:
inputs:
pr:
description: Number of the Pull Request
Expand Down Expand Up @@ -76,9 +76,8 @@ on:
- starters
- testing


jobs:
set-image:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
Expand All @@ -92,6 +91,9 @@ jobs:
runs-on: arc-runners-polkadot-sdk-benchmark
container:
image: ${{ needs.set-image.outputs.IMAGE }}
permissions:
contents: write
pull-requests: write
steps:
- name: Download repo
uses: actions/checkout@v4
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/command-fmt.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Command FMT

on:
workflow_dispatch:
on:
workflow_dispatch:
inputs:
pr:
description: Number of the Pull Request
required: true

jobs:
set-image:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
Expand All @@ -20,8 +20,12 @@ jobs:
cmd-fmt:
needs: [set-image]
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: ${{ needs.set-image.outputs.IMAGE }}
permissions:
contents: write
pull-requests: write
steps:
- name: Download repo
uses: actions/checkout@v4
Expand All @@ -33,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
14 changes: 10 additions & 4 deletions .github/workflows/command-inform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ on:
jobs:
comment:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && startsWith(github.event.comment.body, 'bot ')
steps:
- name: Inform that the new command exist
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, 'bot ') }}
run: gh pr comment ${{ github.event.issue.number }} --body 'We are migrating this bot to be a GitHub Action<br/><br/>Please, see the <a href="https://github.com/paritytech/polkadot-sdk/blob/master/.github/commands-readme.md">documentation on how to use it</a>'
env:
GH_TOKEN: ${{ github.token }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'We are migrating the command bot to be a GitHub Action<br/><br/>Please, see the <a href="https://github.com/paritytech/polkadot-sdk/blob/master/.github/commands-readme.md">documentation on how to use it</a>'
})
71 changes: 71 additions & 0 deletions .github/workflows/command-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Command Sync

on:
workflow_dispatch:
inputs:
pr:
description: Number of the Pull Request
required: true
chain:
description: Chain
type: choice
required: true
options:
- westend
- rococo
sync-type:
description: Sync type
type: choice
required: true
options:
- warp
- full
- fast
- fast-unsafe

jobs:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
cmd-sync:
needs: [set-image]
runs-on: arc-runners-polkadot-sdk-warpsync
container:
image: ${{ needs.set-image.outputs.IMAGE }}
permissions:
contents: write
pull-requests: write
steps:
- name: Download repo
uses: actions/checkout@v4
- name: Install gh cli
id: gh
uses: ./.github/actions/set-up-gh
with:
pr-number: ${{ inputs.pr }}
GH_TOKEN: ${{ github.token }}
- name: Run sync
run: |
"./scripts/sync.sh" --chain "${{ inputs.chain }}" --type "${{ inputs.sync-type }}"
- name: Report failure
if: ${{ failure() }}
run: gh pr comment ${{ inputs.pr }} --body "<h2>Command failed ❌</h2> Run by @${{ github.actor }} for <code>${{ github.workflow }}</code> failed. See logs <a href=\"$RUN\">here</a>."
env:
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GH_TOKEN: ${{ github.token }}
- run: git pull --rebase
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: cmd-action - ${{ github.workflow }}
branch: ${{ steps.gh.outputs.branch }}
- name: Report succeed
run: gh pr comment ${{ inputs.pr }} --body "<h2>Action completed 🎉🎉</h2> Run by @${{ github.actor }} for <code>${{ github.workflow }}</code> completed 🎉. See logs <a href=\"$RUN\">here</a>."
env:
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GH_TOKEN: ${{ github.token }}
Loading

0 comments on commit b793e17

Please sign in to comment.