merge #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Unittest Coverage | |
on: [push, pull_request] | |
jobs: | |
test: | |
if: false == contains(github.event.pull_request.title, 'WIP') | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13] | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
env: | |
OS: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Update setuptools | |
run: | | |
pip install setuptools==68.2.2 wheel==0.41.2 | |
pip install pybind11 | |
- name: Install Ubuntu Dependencies | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libprotobuf-dev protobuf-compiler cmake libgrpc++-dev redis | |
git clone --recurse-submodules -b v1.62.2 --depth 1 --shallow-submodules https://github.com/grpc/grpc | |
cd grpc | |
mkdir -p cmake/build | |
pushd cmake/build | |
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR ../.. | |
make -j 4 | |
sudo make install | |
popd | |
cd .. | |
- name: Install Mac Dependencies | |
if: ${{ matrix.os == 'macos-13' }} | |
run: | | |
brew install protobuf grpc redis | |
- name: Install Minimal Dependencies | |
run: | | |
pip install -q -e . | |
- name: Run minimal import tests | |
run: | | |
python tests/minimal.py | |
- name: Install Full Dependencies | |
run: | | |
pip install -q -e .[full] | |
pip install coverage | |
- name: CPP gRPC Server Tests | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
redis-server &> redis.log & | |
AGENTSCOPE_ENABLE_PY_LOGGER=True AGENTSCOPE_USE_CPP_SERVER=YES AGENTSCOPE_NUM_WORKERS=5 python -m unittest tests/rpc_agent_test.py | |
- name: Run tests with coverage | |
run: | | |
coverage run tests/run.py | |
- name: Generate coverage report | |
run: | | |
coverage report -m |