Skip to content

Commit

Permalink
ci: Add dedicated workflow for pytests
Browse files Browse the repository at this point in the history
Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
  • Loading branch information
BAStos525 committed Sep 27, 2024
1 parent 5a6369a commit 0caffe5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/pr-pytests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Iroha 2 pull request pytests

on:
repository_dispatch:
types: [dispatch-event]

env:
IROHA_REF: 2.0.0-pre-rc.22

jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.12 ]
steps:
- 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 ./configs/swarm/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)
37 changes: 0 additions & 37 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,43 +38,6 @@ jobs:
yapf --style pep8 -e 'iroha2/sys/**/*.py' -r -i iroha2 example
git diff --quiet
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.12 ]
steps:
- 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 code
uses: actions/checkout@v4
with:
repository: 'hyperledger/iroha'
ref: '2.0.0-pre-rc.22'
- name: Run docker-compose.yml containers
run: |
docker compose -f ./configs/swarm/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)
integration-test:
runs-on: iroha-ubuntu-latest
steps:
Expand Down

0 comments on commit 0caffe5

Please sign in to comment.