Skip to content

Commit

Permalink
Merge branch 'master' into avoid-updating-block-gap-when-unchanged
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy authored Sep 4, 2024
2 parents 335ac51 + 4d2f793 commit 79c5e6f
Show file tree
Hide file tree
Showing 325 changed files with 20,760 additions and 11,222 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
/substrate/primitives/merkle-mountain-range/ @acatangiu

# Contracts
/substrate/frame/contracts/ @athei @pgherveou @paritytech/docs-audit
/substrate/frame/revive/ @athei @pgherveou @paritytech/docs-audit
/substrate/frame/contracts/ @paritytech/smart-contracts @paritytech/docs-audit
/substrate/frame/revive/ @paritytech/smart-contracts @paritytech/docs-audit

# NPoS and election
/substrate/frame/election-provider-multi-phase/ @paritytech/staking-core @paritytech/docs-audit
Expand Down
15 changes: 13 additions & 2 deletions .github/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rules:
# excluding files from 'Runtime files' and 'CI files' rules
exclude:
- ^cumulus/parachains/common/src/[^/]+\.rs$
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|revive/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^\.gitlab-ci\.yml
- ^docker/.*
- ^\.github/.*
Expand All @@ -56,7 +56,7 @@ rules:
- name: FRAME coders substrate
condition:
include:
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|revive/.*|election|nomination-pools/.*|staking/.*|aura/.*))
type: "and"
reviewers:
- minApprovals: 2
Expand All @@ -66,6 +66,17 @@ rules:
teams:
- frame-coders

# Smart Contracts
- name: Smart Contracts
type: basic
condition:
include:
- ^substrate/frame/contracts/.*
- ^substrate/frame/revive/.*
minApprovals: 2
teams:
- smart-contracts

# Protection of THIS file
- name: Review Bot
countAuthor: true
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/build-misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build Misc

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:
contents: read

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
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
- id: set_runner
run: |
# Run merge queues on persistent runners
if [[ $GITHUB_REF_NAME == *"gh-readonly-queue"* ]]; then
echo "RUNNER=arc-runners-polkadot-sdk-beefy-persistent" >> $GITHUB_OUTPUT
else
echo "RUNNER=arc-runners-polkadot-sdk-beefy" >> $GITHUB_OUTPUT
fi
build-runtimes-polkavm:
timeout-minutes: 20
needs: [ set-image ]
runs-on: ${{ needs.set-image.outputs.RUNNER }}
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check Rust
run: |
rustup show
rustup +nightly show
- name: Build
env:
SUBSTRATE_RUNTIME_TARGET: riscv
run: |
forklift cargo check -p minimal-template-runtime
forklift cargo check -p westend-runtime
forklift cargo check -p rococo-runtime
forklift cargo check -p polkadot-test-runtime
build-subkey:
timeout-minutes: 20
needs: [ set-image ]
runs-on: ${{ needs.set-image.outputs.RUNNER }}
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check Rust
run: |
rustup show
rustup +nightly show
- name: Build
env:
SKIP_WASM_BUILD: 1
run: |
cd ./substrate/bin/utils/subkey
forklift cargo build --locked --release
confirm-required-build-misc-jobs-passed:
runs-on: ubuntu-latest
name: All build misc jobs passed
# If any new job gets added, be sure to add it to this array
needs:
[
build-runtimes-polkavm,
build-subkey
]
steps:
- run: echo '### Good job! All the build misc tests passed 🚀' >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion .github/workflows/check-runtime-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# We need to set this to rather long to allow the snapshot to be created, but the average time
# should be much lower.
timeout-minutes: 60
needs: [set-image]
needs: [ set-image ]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions: {}
permissions: { }

jobs:
# temporary disabled because currently doesn't work in merge queue
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/command-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: korthout/backport-action@v3
id: backport
with:
target_branches: stable2407
target_branches: stable2407 stable2409
merge_commits: skip
github_token: ${{ secrets.GITHUB_TOKEN }}
pull_description: |
Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/publish-subsystem-benchmarks.yml

This file was deleted.

94 changes: 74 additions & 20 deletions .github/workflows/subsystem-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
branches:
- master
pull_request:
types: [ opened, synchronize, reopened, closed, labeled ]
types: [ opened, synchronize, reopened, ready_for_review ]
merge_group:

concurrency:
Expand All @@ -12,12 +12,9 @@ concurrency:

permissions:
contents: read
pull-requests: write

jobs:
set-image:
# TODO: remove once migration is complete or this workflow is fully stable
if: contains(github.event.label.name, 'GHA-migration')
# 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.
Expand All @@ -31,13 +28,11 @@ jobs:
run: cat .github/env >> $GITHUB_OUTPUT

build:
timeout-minutes: 80
needs: [ set-image ]
runs-on: arc-runners-polkadot-sdk-benchmark
container:
image: ${{ needs.set-image.outputs.IMAGE }}
env:
BENCH_DIR: ./charts/bench/${{ matrix.features.bench }}
BENCH_FILE_NAME: ${{ matrix.features.bench }}
strategy:
fail-fast: false
matrix:
Expand All @@ -57,26 +52,85 @@ jobs:
rustup +nightly show
- name: Run Benchmarks
continue-on-error: true
id: run-benchmarks
run: |
cargo bench -p ${{ matrix.features.name }} --bench ${{ matrix.features.bench }} --features subsystem-benchmarks || echo "Benchmarks failed"
forklift cargo bench -p ${{ matrix.features.name }} --bench ${{ matrix.features.bench }} --features subsystem-benchmarks || echo "Benchmarks failed"
ls -lsa ./charts
mkdir -p $BENCH_DIR || echo "Directory exists"
cp charts/${BENCH_FILE_NAME}.json $BENCH_DIR
ls -lsa $BENCH_DIR
mkdir ./artifacts
cp ./charts/${{ matrix.features.bench }}.json ./artifacts/${{ matrix.features.bench }}.json
- name: Upload artifacts
uses: actions/[email protected]
with:
name: ${{matrix.features.bench}}
path: ./artifacts

publish-benchmarks:
timeout-minutes: 60
needs: [ build ]
if: github.ref == 'refs/heads/master'
environment: subsystem-benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/[email protected]
with:
path: ./artifacts

- name: Setup git
run: |
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory '*'
ls -lsR ./artifacts
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }}
private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }}

- name: Publish result to GH Pages
if: ${{ steps.run-benchmarks.outcome == 'success' }}
- name: Publish ${{ env.BENCH_NAME }}
uses: benchmark-action/github-action-benchmark@v1
env:
BENCH_NAME: availability-recovery-regression-bench
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH_FILE_NAME }}
output-file-path: ${{ env.BENCH_DIR }}/${{ env.BENCH_FILE_NAME }}.json
benchmark-data-dir-path: ${{ env.BENCH_DIR }}
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: ${{ github.event_name == 'pull_request' }} # will comment on PRs if regression is detected
auto-push: false # TODO: enable when gitlab part is removed ${{ github.ref == 'refs/heads/master' }}
name: ${{ env.BENCH_NAME }}
output-file-path: ./artifacts/${{ env.BENCH_NAME }}/${{ env.BENCH_NAME }}.json
benchmark-data-dir-path: ./artifacts/${{ env.BENCH_NAME }}
github-token: ${{ steps.app-token.outputs.token }}

- name: Publish ${{ env.BENCH_NAME }}
uses: benchmark-action/github-action-benchmark@v1
env:
BENCH_NAME: availability-distribution-regression-bench
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH_NAME }}
output-file-path: ./artifacts/${{ env.BENCH_NAME }}/${{ env.BENCH_NAME }}.json
benchmark-data-dir-path: ./artifacts/${{ env.BENCH_NAME }}
github-token: ${{ steps.app-token.outputs.token }}

- name: Publish ${{ env.BENCH_NAME }}
uses: benchmark-action/github-action-benchmark@v1
env:
BENCH_NAME: approval-voting-regression-bench
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH_NAME }}
output-file-path: ./artifacts/${{ env.BENCH_NAME }}/${{ env.BENCH_NAME }}.json
benchmark-data-dir-path: ./artifacts/${{ env.BENCH_NAME }}
github-token: ${{ steps.app-token.outputs.token }}

- name: Publish ${{ env.BENCH_NAME }}
uses: benchmark-action/github-action-benchmark@v1
env:
BENCH_NAME: statement-distribution-regression-bench
with:
tool: "customSmallerIsBetter"
name: ${{ env.BENCH_NAME }}
output-file-path: ./artifacts/${{ env.BENCH_NAME }}/${{ env.BENCH_NAME }}.json
benchmark-data-dir-path: ./artifacts/${{ env.BENCH_NAME }}
github-token: ${{ steps.app-token.outputs.token }}
Loading

0 comments on commit 79c5e6f

Please sign in to comment.