Skip to content

Update CI

Update CI #1172

Workflow file for this run

on:
pull_request:
branches:
- 'main'
name: continuous-integration-main
env:
RUSTUP_NIGHTLY_VERSION: nightly-2024-02-09
RUST_BACKTRACE: full
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
jobs:
# build-check:
# name: Check Build
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
#
# - name: Undergo Prerequisite
# uses: ./.github/actions/prerequisite
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Check Build
# run: |
# bash ./scripts/cmd-all build check
cargo-clippy:
name: Run Clippy and Format Checks
# needs: build-check
# if: needs.build-check.result == 'success'
strategy:
max-parallel: 2
matrix:
rust: [ stable, nightly ]
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run Prerequisite
if: matrix.rust == 'stable'
uses: ./.github/actions/prerequisite
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Prerequisite (for Nightly)
if: matrix.rust == 'nightly'
uses: ./.github/actions/prerequisite-nightly
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
- name: Rustfmt
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
toolchain: ${{ env.RUSTUP_NIGHTLY_VERSION }}
command: fmt
args: --all -- --check
- name: Clippy for Tests and Examples
if: matrix.rust == 'nightly'
uses: actions-rs/cargo@v1
with:
toolchain: ${{ env.RUSTUP_NIGHTLY_VERSION }}
command: clippy
args: --all-features --tests --benches --examples -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references
- name: Clippy -- Libraries and Binaries
if: matrix.rust == 'stable'
run: |
bash ./scripts/cmd-all clippy "clippy --lib --bins" "-- -W clippy::all -A clippy::style -A forgetting_copy_types -A forgetting_references"
cargo-test-pallets:
name: Run Tests for Pallets
# needs: build-check
# if: needs.build-check.result == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run Prerequisite (for Nightly)
uses: ./.github/actions/prerequisite-nightly
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
- name: Run Tests for Pallets
run: |
bash ./scripts/cmd-pallets test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test"
- name: Run Tests for Other Libraries
run: |
bash ./scripts/cmd-pallets test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test"
cargo-test-clients:
name: Run Tests for Clients
needs: cargo-test-pallets
if: needs.cargo-test-pallets.result == 'success'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Undergo Prerequisite (for Nightly)
uses: ./.github/actions/prerequisite
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
- name: Run Tests for Clients
run: |
bash ./scripts/cmd-clients test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test"