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

[fix] #1640: Generate genesis.json and consolidate generation into one tool #2104

Merged
merged 5 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 0 additions & 6 deletions .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,3 @@ jobs:
- name: Verify iroha_data_model still supports no_std
run: cargo nono check --package iroha_data_model --no-default-features
if: always()

- name: Documentation check
run: |
cargo doc --no-deps --quiet
./scripts/check_docs.sh
if: always()
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
30 changes: 23 additions & 7 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,33 @@ 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
run: mold -run cargo build --target wasm32-unknown-unknown --quiet
working-directory: wasm
env:
RUSTC_BOOTSTRAP: 1
- name: Documentation check
run: |
cargo doc --no-deps --quiet
./scripts/check.sh docs
if: always()
- name: Check genesis
run: |
./scripts/check.sh genesis
if: always()

# 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 @@ -51,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
appetrosyan marked this conversation as resolved.
Show resolved Hide resolved
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:
appetrosyan marked this conversation as resolved.
Show resolved Hide resolved
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