Skip to content

Commit

Permalink
Github CI: Test CI to reduce build time with concurrency
Browse files Browse the repository at this point in the history
Signed-off-by: Shreevatsa N <[email protected]>
  • Loading branch information
vatsa287 committed Sep 26, 2024
1 parent e892577 commit f176ec1
Showing 1 changed file with 56 additions and 29 deletions.
85 changes: 56 additions & 29 deletions .github/workflows/ci-on-pr-rustfmt-test-clippy-build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: ci
name: CI
on:
pull_request:
paths-ignore:
- "**.md"
- "doc/**"

# Allows to run this workflow manually from the Actions tab
workflow_dispatch:

defaults:
Expand All @@ -28,7 +26,7 @@ jobs:

- name: install rust nightly
run: rustup toolchain install nightly

- name: show active toolchain
run: rustup show active-toolchain

Expand All @@ -50,14 +48,60 @@ jobs:
test:
runs-on: ubuntu-latest
needs: rustfmt
strategy:
matrix:
package:
- "cord-node-cli"
- "cord-braid-runtime"
- "authority-membership"
- "pallet-network-membership"
- "network-membership"
- "pallet-offences"
- "cord-braid-runtime-constants"
- "cord-primitives"
- "cord-runtime-common"
- "cord-identifier"
- "cord-utilities"
- "pallet-assets-runtime-api"
- "pallet-chain-space"
- "pallet-config"
- "pallet-did"
- "pallet-did-name"
- "pallet-did-runtime-api"
- "pallet-entries"
- "pallet-registries"
- "pallet-identity"
- "pallet-network-score"
- "pallet-node-authorization"
- "pallet-runtime-upgrade"
- "pallet-schema"
- "pallet-session-benchmarking"
- "pallet-statement"
- "pallet-transaction-weight-runtime-api"
- "cord-loom-runtime"
- "cord-loom-runtime-constants"
- "pallet-membership"
- "cord-node-inspect"
- "cord-node-rpc"
- "cord-weave-runtime"
- "cord-weave-runtime-constants"
- "cord-cli-test-utils"
- "cord-node-testing"
- "cord-test-client"
- "cord-service-test"
- "cord-test-runtime"
- "cord-test-runtime-client"
- "pallet-asset"
- "cord-test-utils"
- "cord-test-runtime-transaction-pool"
steps:
- name: checkout repository
uses: actions/[email protected]

- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libssl-dev

- name: cache
- name: cache rust toolchain and dependencies
uses: actions/cache@v4
with:
path: |
Expand All @@ -67,7 +111,9 @@ jobs:
restore-keys: ${{ runner.os }}-rust-

- name: cargo test
run: rustup component add rust-src && cargo test --release --all --all-targets --features=runtime-benchmarks --no-fail-fast --verbose --color always
run: |
rustup component add rust-src
cargo test -p ${{ matrix.package }} --release --features=runtime-benchmarks --no-fail-fast --verbose --color always
clippy:
runs-on: ubuntu-latest
Expand All @@ -79,7 +125,7 @@ jobs:
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libssl-dev

- name: cache
- name: cache rust toolchain and dependencies
uses: actions/cache@v4
with:
path: |
Expand All @@ -89,25 +135,6 @@ jobs:
restore-keys: ${{ runner.os }}-rust-

- name: cargo clippy
run: rustup component add rust-src && cargo clippy --all --no-deps --all-targets --features=runtime-benchmarks -- -D warnings

# build:
# runs-on: ubuntu-latest
# needs: rustfmt
# steps:
# - name: checkout repository
# uses: actions/[email protected]
# - name: install dependencies
# run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libssl-dev

# - name: cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.cargo/
# target/
# key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.os }}-rust-
# - name: cargo build
# run: rustup component add rust-src && cargo build --locked

run: |
rustup component add rust-src
cargo clippy -p ${{ matrix.package }} --all-targets --features=runtime-benchmarks -- -D warnings

0 comments on commit f176ec1

Please sign in to comment.