Skip to content

Commit

Permalink
ci: fix python/poetry usage
Browse files Browse the repository at this point in the history
Signed-off-by: Nurzhan Sakén <[email protected]>
  • Loading branch information
nxsaken committed Sep 20, 2024
1 parent 5b962e4 commit 215fd43
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ env:
CARGO_TERM_COLOR: always
IROHA_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
DOCKER_COMPOSE_PATH: defaults
TEST_DIR: "tmp/test"
IROHA_BIN: "iroha"
IROHA_CONTAINER: "defaults-irohad0-1"

jobs:
consistency:
Expand Down Expand Up @@ -238,6 +235,12 @@ jobs:
needs: build_executor
runs-on: [self-hosted, Linux, iroha2]
timeout-minutes: 60
env:
PYTHON_VERSION: "3.11"
POETRY_PATH: "/root/.local/bin/poetry"
TEST_DIR: "tmp/test"
IROHA_BIN: "iroha"
IROHA_CONTAINER: "defaults-irohad0-1"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -246,12 +249,12 @@ jobs:
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '>=3.11'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install Python and Poetry
run: |
yum install -y python${{ env.PYTHON_VERSION }} python${{ env.PYTHON_VERSION }}-devel
curl -sSL https://install.python-poetry.org | python3 -
echo 'export PATH="${{ env.POETRY_PATH }}:$PATH"' >> /etc/profile
source /etc/profile
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -281,10 +284,10 @@ jobs:
run: docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml up --wait || exit 1
- name: Install Torii pytest dependencies
working-directory: pytests/iroha_torii_tests
run: poetry install
run: ${{ env.POETRY_PATH }} install
- name: Run Torii pytests
working-directory: pytests/iroha_torii_tests
run: poetry run pytest
run: ${{ env.POETRY_PATH }} run pytest
- name: Copy client binary from Iroha container
if: always()
run: |
Expand All @@ -294,7 +297,7 @@ jobs:
chmod +x ${{ env.TEST_DIR }}/${{ env.IROHA_BIN }}
- name: Install client pytest dependencies
working-directory: pytests/iroha_cli_tests
run: poetry install
run: ${{ env.POETRY_PATH }} install
- name: Run client pytests
uses: nick-fields/retry@v3
env:
Expand All @@ -306,7 +309,7 @@ jobs:
max_attempts: 5
command: |
cd pytests/iroha_cli_tests
poetry run pytest
${{ env.POETRY_PATH }} run pytest
on_retry_command: |
docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml down
docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.local.yml up --wait || exit 1
Expand Down

0 comments on commit 215fd43

Please sign in to comment.