forked from QuentinI/iroha-python
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (73 loc) · 2.2 KB
/
iroha2-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Iroha 2 pull request workflow
on:
pull_request:
branches: [iroha2]
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)