Skip to content

dispatch-event

dispatch-event #155

Workflow file for this run

name: Iroha2:PR::Pytests
on:
repository_dispatch:
types: [dispatch-event]
pull_request:
branches: [main]
env:
TOOLCHAIN_VER: nightly-2024-09-09
IROHA_BRANCH: 2.0.0-rc.1
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8 ]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: pip install poetry tomli-w
- name: Checkout irohad repo code
run: git clone --depth 1 https://github.com/hyperledger-iroha/iroha.git -b ${{ env.IROHA_BRANCH }} iroha_daemon
- name: Install correct rust version
run: rustup install ${{ env.TOOLCHAIN_VER }} && rustup component add rust-src --toolchain ${{ env.TOOLCHAIN_VER }}
- name: Set toolchain
run: rustup default ${{ env.TOOLCHAIN_VER }}
- name: Build irohad
run: cd iroha_daemon && cargo build --release && mkdir target/debug -p && cp target/release/irohad target/debug/irohad && cp target/release/iroha target/debug/iroha
- name: Build kagami
run: cd iroha_daemon && cargo build --bin kagami
- name: Build default executor
run: cd iroha_daemon && cargo run --release --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ./defaults/executor.wasm
- name: Maturin build and Run tests
run: bash -c " pip install maturin &&
maturin build &&
cd iroha_daemon && scripts/test_env.py setup && cd .. &&
python -m venv .venv &&
source .venv/bin/activate &&
pip install pytest faker allure-pytest pytest-cov &&
pip install --break-system-packages target/wheels/iroha2-*.whl &&
python -m pytest --cov=. --cov-report xml:coverage-reports/coverage.xml tests/"
- name: Tear down the network
if: always()
run: cd iroha_daemon && scripts/test_env.py cleanup
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: report-coverage
path: coverage-reports/coverage.xml
retention-days: 1