fix conflict #2222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ '**' ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
format: | |
name: Check Lints | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2024-03-12 | |
override: true | |
components: rustfmt | |
- name: Check TOML | |
uses: dprint/check@v2.2 | |
- name: Check Format | |
run: | | |
cargo fmt -- --check | |
check: | |
name: Cargo check | |
needs: format | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install linux dependencies | |
run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler | |
- name: Install toolchain and rust-src | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.77.0 | |
override: true | |
target: wasm32-unknown-unknown | |
components: rust-src | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install try-runtime | |
run: cargo install --git https://github.com/paritytech/try-runtime-cli --tag v0.7.0 --locked | |
- name: Check Build | |
run: | | |
cargo build --release --features try-runtime | |
- name: Check Try-Runtime | |
run: | | |
try-runtime --runtime ./target/release/wbuild/cere-runtime/cere_runtime.compact.compressed.wasm \ | |
on-runtime-upgrade --disable-idempotency-checks live --uri wss://archive.mainnet.cere.network:443 | |
- name: Run dev chain | |
run: | | |
timeout --preserve-status 30s ./target/release/cere --dev | |
- name: Check Build for Benchmarking | |
run: > | |
pushd node && | |
cargo check --features=runtime-benchmarks --release | |
clippy: | |
name: Run Clippy | |
needs: format | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install linux dependencies | |
run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.77.0 | |
override: true | |
target: wasm32-unknown-unknown | |
components: rust-src | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Check with Clippy | |
run: | | |
cargo clippy --no-deps --all-targets --features runtime-benchmarks,try-runtime --workspace -- --deny warnings | |
tests: | |
name: Run tests | |
needs: format | |
# The type of runner that the job will run on | |
runs-on: ["self-hosted", "cere-network-memory-large"] | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Install linux dependencies | |
run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.77.0 | |
override: true | |
target: wasm32-unknown-unknown | |
components: rust-src | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo-tarpaulin | |
uses: actions-rs/tarpaulin@v0.1 | |
with: | |
version: '0.22.0' | |
args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"' | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tarpaulin coverage | |
path: ./tarpaulin-report.xml |