Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
SamHSmith committed Nov 5, 2024
1 parent b090d49 commit 8dfb9e2
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 149 deletions.
60 changes: 36 additions & 24 deletions .github/workflows/pr-pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,52 @@ on:
pull_request:
branches: [main]

env:
IROHA_REF: main

jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.12 ]
steps:
- name: Maturin build and Run tests
run: sudo apt install -y python pip && \
pip install maturin && \
maturin build && \
cd iroha && 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: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install poetry
- name: Checkout iroha main repo code
uses: actions/checkout@v4
with:
repository: 'hyperledger/iroha'
ref: ${{ env.IROHA_REF}}
- name: Run docker-compose.yml containers
run: docker compose -f ./defaults/docker-compose.yml up --wait || exit 1
- name: Checkout code
uses: actions/checkout@v4
- name: Maturin build
run: |
pip install maturin
maturin build
poetry add target/wheels/*
- name: Install project dependencies
run: poetry install
- name: Run tests
run: poetry run pytest tests
- name: Tear down docker containers
if: always()
run: docker stop $(docker ps -q) && docker rm $(docker ps -a -q)
- 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
- 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 && 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 && cargo build --bin kagami
- name: Build default executor
run: cd iroha && 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: sudo apt install -y python pip && \
pip install maturin && \
maturin build && \
cd iroha && 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 && scripts/test_env.py cleanup
20 changes: 1 addition & 19 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches: [main]


jobs:
check:
runs-on: iroha-ubuntu-latest
Expand Down Expand Up @@ -37,22 +38,3 @@ jobs:
cargo run -p generate -- iroha2/sys
yapf --style pep8 -e 'iroha2/sys/**/*.py' -r -i iroha2 example
git diff --quiet
integration-test:
runs-on: iroha-ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Iroha Python test Docker image
uses: docker/build-push-action@v4
with:
push: false
dockerfile: example/Dockerfile
repository: iroha
tags: python-test
- name: Run test in docker
working-directory: example
run: |
docker-compose up -d && sleep 5
docker run --net example_default -v $PWD:/test iroha:python-test \
timeout 5 python3 test.py ||
(docker-compose logs && false)
Loading

0 comments on commit 8dfb9e2

Please sign in to comment.