Skip to content

Commit

Permalink
ci: try pysonar
Browse files Browse the repository at this point in the history
Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
  • Loading branch information
BAStos525 committed Nov 6, 2024
1 parent 8cf76fb commit 90ed311
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
52 changes: 28 additions & 24 deletions .github/workflows/pr-pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
types: [dispatch-event]
pull_request:
branches: [main]
push:
branches: [i2/ci/py-sonar]

jobs:
pytest:
Expand All @@ -20,27 +22,29 @@ jobs:
- 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 2.0.0-rc.1 iroha_daemon
- name: Install correct rust version
run: rustup install nightly-2024-09-09 && rustup component add rust-src --toolchain nightly-2024-09-09
- name: Set toolchain
run: rustup default nightly-2024-09-09
- 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 &&
pip install --break-system-packages target/wheels/iroha-*.whl &&
python -m pytest tests/"
- name: Tear down the network
run: cd iroha_daemon && scripts/test_env.py cleanup
run: pip install poetry tomli-w pysonar-scanner
# - name: Checkout irohad repo code
# run: git clone --depth 1 https://github.com/hyperledger-iroha/iroha.git -b 2.0.0-rc.1 iroha_daemon
# - name: Install correct rust version
# run: rustup install nightly-2024-09-09 && rustup component add rust-src --toolchain nightly-2024-09-09
# - name: Set toolchain
# run: rustup default nightly-2024-09-09
# - 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 &&
# pip install --break-system-packages target/wheels/iroha-*.whl &&
# python -m pytest tests/"
- name: Sonarqube
run: pysonar-scanner -Dsonar.login=${{ secrets.SONAR_TOKEN }}
# - name: Tear down the network
# run: cd iroha_daemon && scripts/test_env.py cleanup
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ python = "^3.9.6"
pytest = "^8.1.1"
faker = "^24.4.0"
allure-pytest = "^2.13.5"
maturin = "^1.7.0"
maturin = "^1.7.0"

[tool.sonar]
projectKey=hyperledger-iroha:iroha-python
host.url=https://sonar.katana.soramitsu.co.jp

0 comments on commit 90ed311

Please sign in to comment.