Skip to content

Commit

Permalink
Merge branch 'main' into bko-collectives-weights
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur authored Jan 22, 2025
2 parents 4001a5c + 81d1f57 commit fee134b
Show file tree
Hide file tree
Showing 15 changed files with 177 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .github/changelog-processor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import sys
Expand Down
15 changes: 15 additions & 0 deletions .github/install-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

sudo apt update
sudo apt install --assume-yes openssl pkg-config g++ make cmake protobuf-compiler libssl-dev libclang-dev libudev-dev git

# Free space on the runner
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h

2 changes: 1 addition & 1 deletion .github/scripts/cmd/cmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import sys
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:
uses: actions/checkout@v4

- name: Verify
run: .github/changelog-processor.py CHANGELOG.md --validate-changelog
run: |
sudo apt install python3
.github/changelog-processor.py CHANGELOG.md --validate-changelog
# This will only run if all the tests in its "needs" array passed.
# Add this as your required job, becuase if the matrix changes size (new things get added)
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/check-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Install stable Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Install Zepter
run: cargo install --locked -q zepter && zepter --version

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Dont clone historic commits.

- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{env.RUST_STABLE_VERSION}}"

- name: Install Zepter
run: cargo install --locked -q zepter && zepter --version

- name: Check features
run: |
zepter run check
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install updates and dependencies
run: .github/install-deps.sh

- name: Build EXTRA_FLAGS
run: |
sudo apt install python3
# When running on relay, we don't need weight checks.
EXTRA_FLAGS="${{ matrix.runtime.extra_args }}"
if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then
Expand Down Expand Up @@ -88,18 +93,15 @@ jobs:
echo "EXTRA_FLAGS=$EXTRA_FLAGS" >> $GITHUB_ENV
echo "CHECKS=$CHECKS" >> $GITHUB_ENV
- name: Install Protoc
uses: arduino/[email protected]
with:
version: "3.6.1"
- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV

- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
shell: bash

- name: Add rust-src component
run: rustup component add rust-src
shell: bash
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
targets: "wasm32-unknown-unknown"
components: "rust-src"
toolchain: "${{env.RUST_STABLE_VERSION}}"

- name: Run ${{ matrix.runtime.name }} Runtime Checks
#uses: "paritytech/[email protected]"
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,31 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler

- name: Checkout
uses: actions/checkout@v4

- name: Install updates and dependencies
run: .github/install-deps.sh

- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV

- name: Install stable toolchain
run: |
rustup toolchain install $RUST_STABLE_VERSION --profile minimal --component clippy
cargo --version
cargo clippy --version
uses: dtolnay/rust-toolchain@master
with:
components: "clippy"
toolchain: "${{env.RUST_STABLE_VERSION}}"

- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
shared-key: "fellowship-cache-clippy"
save-if: ${{ github.ref == 'refs/heads/master' }}

- name: Clippy
run: cargo clippy --all-targets --locked -q
run: |
cargo clippy --version
cargo clippy --all-targets --locked -q
env:
RUSTFLAGS: "-D warnings"
SKIP_WASM_BUILD: 1
26 changes: 14 additions & 12 deletions .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ jobs:
CMD: ${{ steps.get-pr-comment.outputs.group2 }} # to avoid "" around the command
run: |
echo 'help<<EOF' >> $GITHUB_OUTPUT
sudo apt install python3
python3 .github/scripts/cmd/cmd.py $CMD >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -217,14 +218,8 @@ jobs:
env:
JOB_NAME: 'cmd'
if: ${{ startsWith(github.event.comment.body, '/cmd') && !contains(github.event.comment.body, '--help') && contains(needs.fellows.outputs.github-handles, github.event.sender.login) }}
runs-on: ${{ startsWith(github.event.comment.body, '/cmd bench') && 'gitrun-001' || 'ubuntu-22.04' }}
runs-on: ${{ startsWith(github.event.comment.body, '/cmd bench') && 'self-hosted' || 'ubuntu-22.04' }}
steps:
- name: Install updates and protobuf-compiler
if: startsWith(github.event.comment.body, '/cmd bench')
run: |
sudo apt update && sudo apt install --assume-yes \
openssl pkg-config g++ make cmake protobuf-compiler curl libssl-dev libclang-dev libudev-dev git jq
- name: Get command
uses: actions-ecosystem/action-regex-match@v2
id: get-pr-comment
Expand Down Expand Up @@ -274,14 +269,19 @@ jobs:
repository: ${{ needs.get-pr-branch.outputs.repo }}
ref: ${{ needs.get-pr-branch.outputs.pr-branch }}

- name: Install updates and dependencies
if: startsWith(github.event.comment.body, '/cmd bench')
run: .github/install-deps.sh

- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV

- name: Install Rust
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
if: startsWith(steps.get-pr-comment.outputs.group2, 'fmt') || startsWith(steps.get-pr-comment.outputs.group2, 'bench')
with:
targets: "wasm32-unknown-unknown,x86_64-unknown-linux-musl"
components: "rust-src rustfmt clippy"
targets: "wasm32-unknown-unknown"
components: "rust-src, rustfmt"
toolchain: "nightly-${{env.RUST_NIGHTLY_VERSION}}"

- name: Install dependencies for bench
Expand All @@ -294,9 +294,10 @@ jobs:

- name: Setup Cache
if: startsWith(steps.get-pr-comment.outputs.group2, 'bench')
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
shared-key: "fellowship-cmd"
shared-key: "fellowship-cache-cmd"
save-if: ${{ github.ref == 'refs/heads/master' }}

- name: Run cmd
id: cmd
Expand All @@ -306,6 +307,7 @@ jobs:
echo "github.ref: ${{ github.ref }}"
echo "Running command: $CMD on branch ${{ needs.get-pr-branch.outputs.pr-branch }}"
git remote -v
sudo apt install python3
python3 .github/scripts/cmd/cmd.py $CMD
git status
git diff
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ jobs:
run: cat .github/env >> $GITHUB_ENV

- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
targets: "wasm32-unknown-unknown"
components: "rustfmt"
toolchain: "nightly-${{env.RUST_NIGHTLY_VERSION}}"

- name: Install taplo
run: |
rustup toolchain install "nightly-$RUST_NIGHTLY_VERSION" --profile minimal --component rustfmt
cargo install taplo-cli --version $TAPLO_VERSION
- name: Rustfmt (check)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
echo "should-release=$(.github/changelog-processor.py CHANGELOG.md --should-release)" >> $GITHUB_OUTPUT
echo "version=$(.github/changelog-processor.py CHANGELOG.md --print-latest-version)" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
runtime-matrix:
needs: [ collect-release-information ]
if: needs.collect-release-information.outputs.should-release == '1'
Expand All @@ -32,6 +33,7 @@ jobs:
TASKS=$(echo $(cat .github/workflows/runtimes-matrix.json) | sed 's/ //g' )
echo $TASKS
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
build-runtimes:
needs: [ runtime-matrix ]
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
app-id: ${{ secrets.REVIEW_APP_ID }}
private-key: ${{ secrets.REVIEW_APP_KEY }}
- name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/review-bot@v2.6.0
uses: paritytech/review-bot@v2.7.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-token: ${{ steps.team_token.outputs.token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/review-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
- name: Get the GitHub handle of the fellows
uses: paritytech/get-fellows-action@v1.2.0
uses: paritytech/get-fellows-action@v1.3.0
id: fellows
# Require new reviews when the author is pushing and he is not a fellow
- name: Fail when author pushes new code
Expand Down
Loading

0 comments on commit fee134b

Please sign in to comment.