-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (79 loc) · 2.59 KB
/
python_test.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
77
78
79
80
81
name: pythontest
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
jobs:
test_tox:
name: run-tox
runs-on: ubuntu-20.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v1
with:
key: coverage-cargo-ubuntu
continue-on-error: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-java@v1
with:
java-version: '11' # The JDK version to make available on the path.
- name: Download and Run Pravega standalone
run: |
wget https://github.com/pravega/pravega/releases/download/v0.13.0-rc1/pravega-0.13.0.tgz
tar -xzvf pravega-0.13.0.tgz
pravega-0.13.0/bin/pravega-standalone > pravega.log 2>&1 &
sleep 120 && echo "Started standalone"
tail pravega.log
- name: Setup virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Run coverage
run: |
source venv/bin/activate
pip install 'maturin>=0.14,<0.15' virtualenv tox==3.28.0 tox-pyo3
source <(cargo llvm-cov show-env --export-prefix)
export CARGO_TARGET_DIR=$CARGO_LLVM_COV_TARGET_DIR
export CARGO_INCREMENTAL=1
cargo llvm-cov clean --workspace
cargo test
maturin develop
pip install -r requirements.txt
pytest tests --cov=pravega_client --cov-report xml --timeout=300 -vvvvv
cargo llvm-cov --no-run --lcov --output-path coverage.lcov
- uses: codecov/codecov-action@v3
with:
files: coverage.lcov,coverage.xml
name: ${{github.job}}-reports
- name: Upload Pravega standalone logs
uses: actions/upload-artifact@v2
if: always()
with:
name: pravega-standalone-log
path: pravega.log
retention-days: 5