Skip to content

[CI]: Update Iroha 1 branch workflow #157

[CI]: Update Iroha 1 branch workflow

[CI]: Update Iroha 1 branch workflow #157

Workflow file for this run

name: Iroha 2 pull request workflow
on:
pull_request:
branches: [main]
jobs:
check:
runs-on: iroha-ubuntu-latest
container: rust:1.64-buster
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
git \
llvm-dev \
python3-pip
rustup component add clippy rustfmt
pip3 install yapf
cargo install cargo-lints
- name: Format check
run: cargo fmt --all -- --check
- name: Static analysis
run: cargo lints clippy --all --benches --tests
- name: Check regeneration of python sys library and formating (PEP8)
run: |
cargo run -p generate -- iroha2/sys
yapf --style pep8 -e 'iroha2/sys/**/*.py' -r -i iroha2 example
git diff --quiet
pytest:
runs-on: iroha-ubuntu-latest
container: rust:1.64-buster
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
git \
patchelf \
llvm-dev \
python3-pip
pip3 install --upgrade pip
pip3 install maturin pytest
- name: Install iroha2
run: maturin build && pip3 install target/wheels/*
- name: Pytest
working-directory: tests
run: pytest
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)