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

ci: Add dedicated workflow for pytests #215

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On common PR also we need this run.

Suggested change
pull_request:
branches: [main]

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
Loading