-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github CI: Test CI to reduce build time with concurrency
Signed-off-by: Shreevatsa N <[email protected]>
- Loading branch information
Showing
1 changed file
with
56 additions
and
29 deletions.
There are no files selected for viewing
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
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: | ||
|
@@ -28,7 +26,7 @@ jobs: | |
|
||
- name: install rust nightly | ||
run: rustup toolchain install nightly | ||
|
||
- name: show active toolchain | ||
run: rustup show active-toolchain | ||
|
||
|
@@ -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: | | ||
|
@@ -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 | ||
|
@@ -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: | | ||
|
@@ -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 |