Skip to content

Commit

Permalink
[refactor]: Move to clap.
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
  • Loading branch information
appetrosyan committed May 12, 2022
1 parent 12af4e3 commit 22ac3d4
Show file tree
Hide file tree
Showing 34 changed files with 342 additions and 463 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/iroha2-dev-pr-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- "wasm/**.json"
- "wasm/**.toml"
- "wasm/**.yml"
- "data_model/**.rs"
- "data_model/**.toml"

env:
RUSTC_BOOTSTRAP: 1
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: mold -run cargo test --quiet --workspace --no-fail-fast -- --skip unstable_network --test-threads 2
run: mold --run cargo test --quiet --workspace --no-fail-fast -- --skip unstable_network --test-threads 2
- name: Run iroha tests with network mock
run: mold -run cargo test --quiet --features mock -- --ignored --skip unstable_network --test-threads 2
run: mold --run cargo test --quiet --features mock -- --ignored --skip unstable_network --test-threads 2
working-directory: core/test_network
- name: Run iroha_actor deadlock detection tests
run: mold -run cargo test --quiet --features deadlock_detection -- --skip unstable_network --test-threads 2
run: mold --run cargo test --quiet --features deadlock_detection -- --skip unstable_network --test-threads 2
working-directory: actor
if: always()
- name: Verify wasm smartcontracts are able to build
Expand All @@ -51,7 +51,8 @@ jobs:

# Coverage is both in PR and in push pipelines so that:
# 1. PR can get coverage report from bot.
# 2. Coverage bot can have results from `iroha2-dev` to report coverage changes.
# 2. Coverage bot can have results from
# `iroha2-dev` to report coverage changes.
coverage:
runs-on: ubuntu-latest
container:
Expand All @@ -60,13 +61,19 @@ jobs:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: mold -run cargo test --quiet --workspace --no-fail-fast -- --skip unstable_network --test-threads 2 || true
run: |
mold --run cargo +nightly-2022-04-20 test \
--quiet --workspace --no-fail-fast -- \
--skip unstable_network --skip ui --test-threads 3
env:
RUSTFLAGS: "-Zinstrument-coverage"
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "iroha-%p-%m.profraw"
- name: Generate a grcov coverage report
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
if: always()
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v1
if: always()
with:
file: lcov.info
29 changes: 18 additions & 11 deletions .github/workflows/iroha2-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
with:
context: .
push: true
tags: hyperledger/iroha2:crypto-cli-dev
tags: hyperledger/iroha2:kagami-dev
build-args: |
TARGET_DIR=release
PROFILE=--release
BIN=iroha_crypto_cli
BIN=kagami
- name: Build and push load-rs:dev docker image
run: |
run: |
sleep 10s
echo "wait to other workflow"
- uses: convictional/trigger-workflow-and-wait@v1.6.0
Expand Down Expand Up @@ -112,11 +112,11 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: cargo-crypto-cli-build-release
path: target/release/iroha_crypto_cli
path: target/release/kagami
- name: Run schema generation
run: |
mkdir -p target/schema
cargo run -p iroha_schema_bin > target/schema/schema.json
cargo run --bin kagami -- schema > target/schema/schema.json
- name: Upload schema
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -145,7 +145,8 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends lz4 jq
- name: Print debug telemetry info
run: ./scripts/analyze_telemetry.sh target/telemetry/debug.json.lz4 >target/telemetry/debug.md
run: |
./scripts/analyze_telemetry.sh target/telemetry/debug.json.lz4 >target/telemetry/debug.md
- name: Print release telemetry info
run: ./scripts/analyze_telemetry.sh target/telemetry/release.json.lz4 >target/telemetry/release.md
- name: Print debug telemetry info
Expand Down Expand Up @@ -175,7 +176,8 @@ jobs:

# Coverage is both in PR and in push pipelines so that:
# 1. PR can get coverage report from bot.
# 2. Coverage bot can have results from `iroha2-dev` to report coverage changes.
# 2. Coverage bot can have results from
# `iroha2-dev` to report coverage changes.
coverage:
runs-on: ubuntu-latest
container:
Expand All @@ -184,14 +186,19 @@ jobs:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: mold -run cargo test --workspace --no-fail-fast -- --skip unstable_network || true
run: |
mold --run cargo +nightly-2022-04-20 test \
--quiet --workspace --no-fail-fast -- \
--skip unstable_network --skip ui --test-threads 3
env:
RUSTFLAGS: "-Zinstrument-coverage"
RUSTC_BOOTSTRAP: 1
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "iroha-%p-%m.profraw"
- name: Generate a grcov coverage report
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
if: always()
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v1
if: always()
with:
file: lcov.info
4 changes: 2 additions & 2 deletions .github/workflows/iroha2-push-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
with:
context: .
push: true
tags: hyperledger/iroha2:crypto-cli-dev-nightly-${{ github.sha }}
tags: hyperledger/iroha2:kagami-dev-nightly-${{ github.sha }}
build-args: |
TARGET_DIR=release
PROFILE=--release
BIN=iroha_crypto_cli
BIN=kagami
23 changes: 17 additions & 6 deletions .github/workflows/iroha2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ env:
RUSTC_BOOTSTRAP: 1

jobs:
# Coverage is both in PR and in push pipelines so that:
# 1. PR can get coverage report from bot.
# 2. Coverage bot can have results from
# `iroha2-dev` to report coverage changes.
coverage:
runs-on: ubuntu-latest
container:
Expand All @@ -17,17 +21,24 @@ jobs:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: mold -run cargo test --quiet --workspace --no-fail-fast -- --skip unstable_network --test-threads 2 || true
run: |
mold --run cargo +nightly-2022-04-20 test \
--quiet --workspace --no-fail-fast -- \
--skip unstable_network --skip ui --test-threads 3
env:
RUSTFLAGS: "-Zinstrument-coverage"
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "iroha-%p-%m.profraw"
- name: Generate a grcov coverage report
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
run: |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
if: always()
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v1
if: always()
with:
file: lcov.info


deploy:
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -59,7 +70,7 @@ jobs:
with:
context: .
push: true
tags: hyperledger/iroha2:stable-client-cli
tags: hyperledger/iroha2:client-cli-stable
build-args: |
TARGET_DIR=release
PROFILE=--release
Expand All @@ -69,11 +80,11 @@ jobs:
with:
context: .
push: true
tags: hyperledger/iroha2:stable-crypto-cli
tags: hyperledger/iroha2:kagami-stable
build-args: |
TARGET_DIR=release
PROFILE=--release
BIN=iroha_crypto_cli
BIN=kagami
- name: Build and push load-rs:release docker image
run: |
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following is a short set of guidelines for contributing to Iroha.
* Fix your issue of choice.
* Write [tests](https://doc.rust-lang.org/cargo/commands/cargo-test.html). Ensure they all pass (`cargo test`).
* Fix [`clippy`](https://lib.rs/crates/cargo-lints) warnings: `cargo lints clippy --workspace --benches --tests --examples --all-features`
* Format code `cargo +nightly fmt --all` and generate docs `cargo run --bin iroha_docs >"docs/source/references/config.md" && git add "docs/source/references/config.md"`
* Format code `cargo +nightly fmt --all` and generate docs `cargo run --bin kagami -- docs >"docs/source/references/config.md" && git add "docs/source/references/config.md"`
* `git pull -r hyperledger iroha2-dev`, `git commit -s`, `git push <your-fork>`, and [create a pull request](https://github.com/hyperledger/iroha/compare) to the `iroha2-dev` branch on GitHub.

### Reporting Bugs
Expand Down Expand Up @@ -149,7 +149,7 @@ Set the `LOG_FILE_PATH` environment variable to an appropriate location to store
- Limit the first line of your commit message to 50 characters or less.
- The first line of your commit message should contain the summary of the work you've done. If you need more than one line, leave a blank line between each paragraph and describe your changes in the middle. The last line must be the sign-off.
- Use the [Git Rebase Workflow](https://git-rebase.io/). Avoid using `git pull` use `git pull --rebase` instead.
- If you modify the Schema (check by generating the schema with `iroha_schema_bin` and diff), you should make all changes to the schema in a separate commit with the message `[schema]`.
- If you modify the Schema (check by generating the schema with `kagami schema` and diff), you should make all changes to the schema in a separate commit with the message `[schema]`.
- Generally, try to stick to one commit per meaningful change.
- If you fixed several issues in one PR, give them separate commits.
- As mentioned previously changes to the `schema` and the API should be done in appropriate commits separate from the rest of your work.
Expand Down
Loading

0 comments on commit 22ac3d4

Please sign in to comment.