diff --git a/.github/workflows/tests_suite.yml b/.github/workflows/tests_suite.yml index 8638398674..b37e8bd9fd 100644 --- a/.github/workflows/tests_suite.yml +++ b/.github/workflows/tests_suite.yml @@ -2,7 +2,7 @@ name: Test Suite (master) on: pull_request: - types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] + types: [opened, synchronize, reopened, labeled, unlabeled] schedule: - cron: '0 23 * * *' @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v2 if: matrix.os == 'ubuntu-20.04' || github.event.pull_request.draft == false with: - submodules: true + submodules: true - name: Set up Python 3.8 if: matrix.os == 'ubuntu-20.04' || github.event.pull_request.draft == false uses: actions/setup-python@v2 @@ -84,7 +84,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true + submodules: true - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -113,7 +113,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true + submodules: true - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -138,7 +138,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true + submodules: true - name: Build image run: | docker build --tag opendr/opendr-toolkit:cpu_test --file Dockerfile . @@ -179,7 +179,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true + submodules: true - name: Set up Python 3.8 uses: actions/setup-python@v2 with: diff --git a/.github/workflows/tests_suite_develop.yml b/.github/workflows/tests_suite_develop.yml index 8513c2c22d..b9d9825f2c 100644 --- a/.github/workflows/tests_suite_develop.yml +++ b/.github/workflows/tests_suite_develop.yml @@ -1,5 +1,7 @@ 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 * * *' @@ -10,7 +12,7 @@ defaults: jobs: cleanup-runs: - if: ${{ contains(github.event.pull_request.labels.*.name, 'test sources') || contains(github.event.pull_request.labels.*.name, 'test tools') || github.event_name == 'schedule' }} + if: ${{ contains(github.event.pull_request.labels.*.name, 'test sources') || contains(github.event.pull_request.labels.*.name, 'test tools') || contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} runs-on: ubuntu-latest steps: - uses: rokroskar/workflow-run-cleanup-action@master @@ -83,8 +85,8 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true - ref: develop + submodules: true + ref: develop - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -106,3 +108,163 @@ jobs: source tests/sources/tools/control/mobile_manipulation/run_ros.sh python -m unittest discover -s tests/sources/tools/${{ matrix.package }} fi + build-wheel: + needs: cleanup-runs + if: ${{ contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} + runs-on: ubuntu-20.04 + 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: Install prerequisites + run: | + python -m pip install --upgrade pip + 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: + needs: cleanup-runs + if: ${{ contains(github.event.pull_request.labels.*.name, 'test release') || github.event_name == 'schedule' }} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + ref: develop + - name: Build image + run: | + docker build --tag opendr/opendr-toolkit:cpu_test --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: + 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/object_tracking_2d + - perception/pose_estimation + - perception/speech_recognition + - perception/skeleton_based_action_recognition + - perception/semantic_segmentation + - perception/object_detection_2d + - perception/facial_expression_recognition + # - perception/object_detection_3d + # - control/mobile_manipulation + # - simulation/human_model_generation + # - control/single_demo_grasp + # - perception/object_tracking_3d + runs-on: ubuntu-20.04 + 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: Download artifact + uses: actions/download-artifact@v2 + with: + path: artifact + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v5.1 + - name: Test Wheel + run: | + export DISABLE_BCOLZ_AVX2=true + 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 + wget https://raw.githubusercontent.com/opendr-eu/opendr/${{ steps.branch-name.outputs.current_branch }}/dependencies/pip_requirements.txt + cat pip_requirements.txt | xargs -n 1 -L 1 pip install + pip install ./artifact/wheel-artifact/*.tar.gz + python -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: + 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/object_tracking_2d + - perception/pose_estimation + - perception/speech_recognition + - perception/skeleton_based_action_recognition + - perception/semantic_segmentation + - perception/object_detection_2d + - perception/facial_expression_recognition + - perception/object_detection_3d + - control/mobile_manipulation + - simulation/human_model_generation + - control/single_demo_grasp + # - perception/object_tracking_3d + runs-on: ubuntu-20.04 + steps: + - 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 + docker exec -i toolkit bash -c "source bin/activate.sh && source tests/sources/tools/control/mobile_manipulation/run_ros.sh && python -m unittest discover -s tests/sources/tools/${{ matrix.package }}" + 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] + 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