Skip to content

Unit tests

Unit tests #9

Workflow file for this run

name: Unit tests
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
target: x86_64-unknown-linux-gnu
- name: Setup Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Setup dependencies
run: |
pip install --upgrade pip
pip install pytest typing_extensions
pip install https://github.com/Tribler/py-ipv8/archive/master.zip
- name: Check rust formatting (rustfmt)
run: cargo fmt --all -- --check
- name: Build and run Python tests
run: |
cargo build
cp target/debug/librust_endpoint.so ipv8_rust_tunnels/rust_endpoint.so
export PYTHONPATH=$(pwd):$PYTHONPATH
echo "PYTHONPATH=.:$PYTHONPATH" >> $GITHUB_ENV
pytest ipv8_rust_tunnels