Test Suite (develop) #604
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: Test Suite (develop) | |
# note: this workflow is only triggered by the nightly scheduled run. | |
# it is identical to master's workflow, but targets the develop branch. | |
on: | |
schedule: | |
- cron: '0 23 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test-sources: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test sources') || github.event_name == 'schedule' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macos-11] | |
include: | |
- os: ubuntu-20.04 | |
DEPENDENCIES_INSTALLATION: "sudo apt update; sudo apt -y install clang-format-10 cppcheck" | |
- os: macos-11 | |
DEPENDENCIES_INSTALLATION: "brew install clang-format@11 cppcheck; ln /usr/local/bin/clang-format-11 /usr/local/bin/clang-format" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
if: matrix.os == 'ubuntu-20.04' || github.event.pull_request.draft == false | |
with: | |
submodules: true | |
ref: develop | |
- name: Set up Python 3.8 | |
if: matrix.os == 'ubuntu-20.04' || github.event.pull_request.draft == false | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Test Sources | |
if: matrix.os == 'ubuntu-20.04' || github.event.pull_request.draft == false | |
run: | | |
${{ matrix.DEPENDENCIES_INSTALLATION }} | |
export OPENDR_HOME=$PWD | |
export OPENDR_DEVICE=cpu | |
pip install -r tests/requirements.txt | |
python -m unittest discover -s tests | |
test-tools: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test tools') || github.event_name == 'schedule' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
package: | |
- engine | |
- utils | |
- perception/activity_recognition | |
- perception/compressive_learning | |
- perception/face_recognition | |
- perception/heart_anomaly_detection | |
- perception/multimodal_human_centric | |
- perception/pose_estimation | |
- perception/fall_detection | |
- perception/speech_recognition | |
- perception/skeleton_based_action_recognition/costgcn | |
- perception/skeleton_based_action_recognition/pstgcn | |
- perception/skeleton_based_action_recognition/stbln | |
- perception/skeleton_based_action_recognition/stgcn | |
- perception/skeleton_based_action_recognition/tagcn | |
- perception/semantic_segmentation | |
- perception/binary_high_resolution | |
- perception/object_tracking_2d | |
# - perception/object_tracking_3d # passes, but disabled due to free() crash | |
- perception/object_detection_2d/centernet | |
- perception/object_detection_2d/detr | |
- perception/object_detection_2d/gem | |
- perception/object_detection_2d/ssd | |
- perception/object_detection_2d/nanodet | |
- perception/object_detection_2d/yolov3 | |
- perception/object_detection_2d/yolov5 | |
- perception/object_detection_2d/retinaface | |
- perception/object_detection_2d/nms | |
# - perception/object_detection_3d # passes, but disabled due to free() crash | |
- perception/facial_expression_recognition | |
- simulation/human_model_generation | |
- control/mobile_manipulation | |
- control/single_demo_grasp | |
- planning/end_to_end_planning | |
- control/multi_object_search | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
ref: develop | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Test Tools | |
run: | | |
export ROS_DISTRO=noetic | |
export OPENDR_HOME=$PWD | |
./bin/install.sh | |
source bin/activate.sh | |
python3 -m pip install -r tests/sources/requirements.txt | |
if [ ${{ matrix.package }} = "ctests" ]; then | |
make ctests | |
else | |
if [[ ${{ matrix.package }} == "control/mobile_manipulation" || ${{ matrix.package }} == "planning/end_to_end_planning" ]]; then | |
source tests/sources/tools/control/mobile_manipulation/run_ros.sh | |
fi | |
python3 -m unittest discover -s tests/sources/tools/${{ matrix.package }} | |
fi | |
build-wheel: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: develop | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install prerequisites | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install setuptools wheel twine | |
- name: Build Wheel | |
run: | |
./bin/build_wheel.sh | |
- name: Upload wheel as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheel-artifact | |
path: | |
dist/*.tar.gz | |
build-docker: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Free Disk Space | |
uses: jlumbroso/[email protected] | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: develop | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Build image | |
run: | | |
docker build --no-cache --tag opendr/opendr-toolkit:cpu_test --build-arg branch=${{ steps.branch-name.outputs.current_branch }} --build-arg ros_distro=noetic --file Dockerfile . | |
docker save opendr/opendr-toolkit:cpu_test > cpu_test.zip | |
- name: Upload image artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: docker-artifact | |
path: | |
cpu_test.zip | |
test-wheel: | |
needs: build-wheel | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
package: | |
- engine | |
- utils | |
- perception/activity_recognition | |
- perception/compressive_learning | |
- perception/face_recognition | |
- perception/heart_anomaly_detection | |
- perception/multimodal_human_centric | |
- perception/pose_estimation | |
- perception/fall_detection | |
- perception/speech_recognition | |
- perception/skeleton_based_action_recognition/costgcn | |
- perception/skeleton_based_action_recognition/pstgcn | |
- perception/skeleton_based_action_recognition/stbln | |
- perception/skeleton_based_action_recognition/stgcn | |
- perception/skeleton_based_action_recognition/tagcn | |
- perception/semantic_segmentation | |
- perception/binary_high_resolution | |
- perception/object_tracking_2d | |
# - perception/object_tracking_3d # passes, but disabled due to free() crash | |
- perception/object_detection_2d/centernet | |
- perception/object_detection_2d/detr | |
- perception/object_detection_2d/gem | |
- perception/object_detection_2d/ssd | |
- perception/object_detection_2d/nanodet | |
- perception/object_detection_2d/yolov3 | |
- perception/object_detection_2d/yolov5 | |
- perception/object_detection_2d/retinaface | |
- perception/object_detection_2d/nms | |
# - perception/object_detection_3d # passes, but disabled due to free() crash | |
- perception/facial_expression_recognition | |
- simulation/human_model_generation | |
#- control/multi_object_search | |
#- control/mobile_manipulation | |
#- control/single_demo_grasp | |
#- planning/end_to_end_planning | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: develop | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifact | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Test Wheel | |
run: | | |
export OPENDR_HOME=$PWD | |
export DISABLE_BCOLZ_AVX2=true | |
export OPENDR_DEVICE=cpu | |
export PYTHONPATH=$OPENDR_HOME/src:$PYTHONPATH | |
export ROS_DISTRO=noetic | |
sudo apt -y install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget libopenblas-dev libsndfile1 libboost-dev python3-dev | |
python3 -m venv venv | |
source venv/bin/activate | |
python3 -m pip install --upgrade pip | |
python3 -m pip install wheel==0.38.4 | |
# install all tools one at a time | |
while read f; do | |
package=$(sed "s/_/-/g" <<< $f) | |
package=(${package//// }) | |
if [ ! -z ${package[1]} ]; then package=${package[1]}; fi | |
if [ "$package" != "opendr" ]; then | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-$package-*.tar.gz | |
fi | |
done < packages.txt | |
cd src/opendr/perception/object_detection_2d/retinaface; make; cd $OPENDR_HOME | |
# run the test | |
python3 -m unittest discover -s tests/sources/tools/${{ matrix.package }} | |
test-wheel-separate: | |
needs: build-wheel | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
package: | |
- engine | |
- utils | |
- perception/activity_recognition | |
- perception/compressive_learning | |
- perception/face_recognition | |
- perception/heart_anomaly_detection | |
- perception/multimodal_human_centric | |
- perception/pose_estimation | |
- perception/fall_detection | |
- perception/speech_recognition | |
- perception/skeleton_based_action_recognition/costgcn | |
- perception/skeleton_based_action_recognition/pstgcn | |
- perception/skeleton_based_action_recognition/stbln | |
- perception/skeleton_based_action_recognition/stgcn | |
- perception/skeleton_based_action_recognition/tagcn | |
- perception/semantic_segmentation | |
- perception/binary_high_resolution | |
- perception/object_tracking_2d | |
# - perception/object_tracking_3d # passes, but disabled due to free() crash | |
- perception/object_detection_2d/centernet | |
- perception/object_detection_2d/detr | |
- perception/object_detection_2d/gem | |
- perception/object_detection_2d/ssd | |
- perception/object_detection_2d/nanodet | |
- perception/object_detection_2d/yolov3 | |
- perception/object_detection_2d/yolov5 | |
- perception/object_detection_2d/retinaface | |
- perception/object_detection_2d/nms | |
# - perception/object_detection_3d # passes, but disabled due to free() crash | |
- perception/facial_expression_recognition | |
- simulation/human_model_generation | |
#- control/multi_object_search | |
#- control/mobile_manipulation | |
#- control/single_demo_grasp | |
#- planning/end_to_end_planning | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: develop | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifact | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Test Wheel Separate | |
run: | | |
export OPENDR_HOME=$PWD | |
export DISABLE_BCOLZ_AVX2=true | |
export OPENDR_DEVICE=cpu | |
export PYTHONPATH=$OPENDR_HOME/src:$PYTHONPATH | |
export ROS_DISTRO=noetic | |
sudo apt -y install python3.8-venv libfreetype6-dev git build-essential cmake python3-dev wget libopenblas-dev libsndfile1 libboost-dev libeigen3-dev | |
python3 -m venv venv | |
source venv/bin/activate | |
python3 -m pip install --upgrade pip | |
python3 -m pip install wheel==0.38.4 | |
# get the name of the wheel to install based on the test being run | |
package=$(sed "s/_/-/g" <<< ${{ matrix.package }}) | |
package=(${package//// }) | |
if [ ! -z ${package[1]} ]; then package=${package[1]}; fi | |
# all packages require the engine | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-engine-*.tar.gz | |
# install specific package | |
if [ ${{ matrix.package }} == "utils" ]; then | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-hyperparameter-tuner-*.tar.gz | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-ambiguity-measure-*.tar.gz | |
else | |
# install required dependencies for derived tools, we do so manually to ensure the local one is used | |
if [ ${{ matrix.package }} == "perception/fall_detection" ]; then | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-pose-estimation-*.tar.gz | |
elif [ ${{ matrix.package }} == "perception/heart_anomaly_detection" ]; then | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-compressive-learning-*.tar.gz | |
elif [ ${{ matrix.package }} == "perception/multimodal_human_centric" ]; then | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-compressive-learning-*.tar.gz | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-object-detection-2d-*.tar.gz | |
elif [ ${{ matrix.package }} == "perception/object_tracking_3d" ]; then | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-object-detection-3d-*.tar.gz | |
fi | |
# install the package itself | |
python3 -m pip install --find-links ./artifact/wheel-artifact/ ./artifact/wheel-artifact/opendr-toolkit-$package-*.tar.gz | |
fi | |
if [[ ${{ matrix.package }} == "perception/object_detection_2d/retinaface" ]]; then | |
cd src/opendr/perception/object_detection_2d/retinaface; make; cd $OPENDR_HOME | |
fi | |
# run the test | |
python3 -m unittest discover -s tests/sources/tools/${{ matrix.package }} | |
test-docker: | |
needs: build-docker | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
package: | |
- engine | |
- utils | |
- perception/activity_recognition | |
- perception/compressive_learning | |
- perception/face_recognition | |
- perception/heart_anomaly_detection | |
- perception/multimodal_human_centric | |
- perception/pose_estimation | |
- perception/fall_detection | |
- perception/speech_recognition | |
- perception/skeleton_based_action_recognition/costgcn | |
- perception/skeleton_based_action_recognition/pstgcn | |
- perception/skeleton_based_action_recognition/stbln | |
- perception/skeleton_based_action_recognition/stgcn | |
- perception/skeleton_based_action_recognition/tagcn | |
- perception/semantic_segmentation | |
- perception/binary_high_resolution | |
- perception/object_tracking_2d | |
# - perception/object_tracking_3d # passes, but disabled due to free() crash | |
- perception/object_detection_2d/centernet | |
- perception/object_detection_2d/detr | |
- perception/object_detection_2d/gem | |
- perception/object_detection_2d/ssd | |
- perception/object_detection_2d/nanodet | |
- perception/object_detection_2d/yolov3 | |
- perception/object_detection_2d/yolov5 | |
- perception/object_detection_2d/retinaface | |
- perception/object_detection_2d/nms | |
# - perception/object_detection_3d # passes, but disabled due to free() crash | |
- perception/facial_expression_recognition | |
- simulation/human_model_generation | |
- control/mobile_manipulation | |
- control/single_demo_grasp | |
- planning/end_to_end_planning | |
# - control/multi_object_search # needs CUDA Docker container | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Free Disk Space | |
uses: jlumbroso/[email protected] | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifact | |
- name: Test docker | |
run: | | |
docker load < ./artifact/docker-artifact/cpu_test.zip | |
docker run --name toolkit -i opendr/opendr-toolkit:cpu_test bash | |
docker start toolkit | |
if [[ ${{ matrix.package }} == "control/mobile_manipulation" || ${{ matrix.package }} == "planning/end_to_end_planning" ]]; then | |
docker exec -i toolkit bash -c "source bin/activate.sh && source tests/sources/tools/control/mobile_manipulation/run_ros.sh && python3 -m unittest discover -s tests/sources/tools/${{ matrix.package }}" | |
else | |
docker exec -i toolkit bash -c "source bin/activate.sh && python3 -m unittest discover -s tests/sources/tools/${{ matrix.package }}" | |
fi | |
delete-docker-artifacts: | |
needs: [build-docker, test-docker] | |
if: ${{ always() }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Delete docker artifacts | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: docker-artifact | |
delete-wheel-artifacts: | |
needs: [build-wheel, test-wheel, test-wheel-separate] | |
if: ${{ always() }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Delete wheel artifacts | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: wheel-artifact |