Skip to content

[CSUB-768] Add NPoS pallets #36

[CSUB-768] Add NPoS pallets

[CSUB-768] Add NPoS pallets #36

Workflow file for this run

---
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main, testnet, dev]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions: read-all
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure rustc version
run: |
RUSTC_VERSION=$(cat rust-toolchain.toml | grep channel | tail -n1 | tr -d " " | cut -f2 -d'"')
echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV"
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
profile: minimal
override: true
components: rustfmt
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set-Up
run: |
sudo apt-get update
sudo apt install -y protobuf-compiler
- name: Configure rustc version
run: |
RUSTC_VERSION=$(cat rust-toolchain.toml | grep channel | tail -n1 | tr -d " " | cut -f2 -d'"')
echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV"
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
target: wasm32-unknown-unknown
profile: minimal
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings -A clippy::too_many_arguments -A clippy::type_complexity
check:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Set-Up
run: |
sudo apt-get update
sudo apt install -y protobuf-compiler
- name: Configure rustc version
run: |
RUSTC_VERSION=$(cat rust-toolchain.toml | grep channel | tail -n1 | tr -d " " | cut -f2 -d'"')
echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV"
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUSTC_VERSION }}
target: wasm32-unknown-unknown
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
- name: Check Build
run: |
SKIP_WASM_BUILD=1 cargo check --release
- name: Check Build for Benchmarking
run: |
SKIP_WASM_BUILD=1 cargo check --features=runtime-benchmarks --release
shellcheck:
name: "🐚 Shellcheck"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
env:
SHELLCHECK_OPTS: -e SC2002 # allow useless cat commands