Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI segmentation improvements #1542

Merged
merged 8 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/iroha2-add-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Add Iroha2 label
on:
pull_request_target:
branches: [iroha2-dev, iroha2]
types: [opened]

jobs:
add_label:
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/iroha2-dev-heavy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: I2::Dev::Tests (Heavy)

on:
push:
branches: [iroha2-dev]
paths:
- '**.rs'
- '**.json'
- '**.toml'
- '**.yml'

env:
CARGO_TERM_COLOR: always

jobs:
test-docker:
e-ivkov marked this conversation as resolved.
Show resolved Hide resolved
#runs-on: [ self-hosted, Linux ] #ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo
target/
key: iroha2-rust-docker-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-docker-

- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.55
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
llvm-dev
- name: Build Client CLI
run: cargo build
working-directory: client_cli
- name: Build and push Iroha Docker image
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: hyperledger/iroha2:dev

- name: Setup docker test environment
run: ./scripts/setup_docker_test_env.sh
- name: Docker compose genesis test
run: bash -c './scripts/test_genesis_docker_compose.sh || ( docker-compose logs; false )'
- name: Docker compose test
run: bash -c './scripts/test_docker_compose.sh || ( docker-compose logs; false )'
- name: Cleanup docker test environment
run: ./scripts/cleanup_docker_test_env.sh

bench:
runs-on: [self-hosted, Linux]
container: rust:1.55-buster
if: ${{ false }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ env.CARGO_HOME }}
target/
key: iroha2-rust-bench-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-bench-

- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
llvm-dev
- name: Run benchmarks
run: cargo bench --workspace --verbose
41 changes: 41 additions & 0 deletions .github/workflows/iroha2-dev-pr-heavy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: I2::Dev::Tests (Heavy)

on:
pull_request:
branches: [iroha2-dev]
paths:
- '**.rs'
- '**.json'
- '**.toml'
- '**.yml'

env:
CARGO_TERM_COLOR: always


jobs:
bench:
runs-on: [self-hosted, Linux]
container: rust:1.55-buster
if: ${{ false }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ env.CARGO_HOME }}
target/
key: iroha2-rust-bench-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-bench-

- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
llvm-dev
- name: Run benchmarks
run: cargo bench --workspace --verbose
50 changes: 50 additions & 0 deletions .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: I2::Dev::Static Analysis

on:
pull_request:
branches: [iroha2-dev]


jobs:
check:
runs-on: [self-hosted, Linux] #ubuntu-latest
container: rust:1.55-buster
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ env.CARGO_HOME }}
target/
key: iroha2-rust-check-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-check
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
llvm-dev
- name: Install clippy
run: rustup component add clippy
- name: Print all info
run: |
cargo version
lscpu
free -h
- name: Install cargo-lints
run: cargo install cargo-lints
- name: Install nightly for rustfmt
run: rustup install --profile default nightly-2021-03-24
- name: Format check
run: cargo +nightly-2021-03-24 fmt --all -- --check
- name: Static analysis without features
run: cargo lints clippy --workspace --benches --tests
- name: Static analysis with all features enabled
run: cargo lints clippy --workspace --benches --tests --all-features
- name: Documentation check
run: |
cargo doc --no-deps
./scripts/check_docs.sh
40 changes: 40 additions & 0 deletions .github/workflows/iroha2-dev-pr-unstable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: I2::Dev::Tests (Unstable)

on:
pull_request:
branches: [iroha2-dev]
paths:
- '**.rs'
- '**.json'
- '**.toml'
- '**.yml'

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: [self-hosted, Linux] #ubuntu-latest
container: rust:1.55-buster
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
${{ env.CARGO_HOME }}
target/
key: iroha2-rust-test-${{ hashFiles('Cargo.lock') }}
restore-keys: |
iroha2-rust-test

- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
llvm-dev
- name: Run tests
run: cargo test -p iroha_client --tests unstable_network
Loading