clean dependencies #21
Workflow file for this run
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: Tests & Coverage | |
on: [ push, pull_request ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install EGL mesa - required for Panda3D renderer | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt-get install -y -qq libegl1-mesa libegl1-mesa-dev | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: happypose | |
python-version: ${{ matrix.python-version }} | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
- name: Get date for caching, reset cache every day | |
id: get-date | |
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" | |
shell: bash | |
- name: Caching of the happypose installation | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CONDA }}/envs | |
key: | |
conda-${{ runner.os }}--${{ runner.arch }}--${{steps.get-date.outputs.today }}-${{hashFiles('environment.yml') }}-${{env.CACHE_NUMBER }} | |
env: | |
# Increase this value to reset cache manually | |
CACHE_NUMBER: 0 | |
id: cache | |
- name: Update conda environment with happypose dependencies | |
run: mamba env update -n happypose -f environment.yml | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Install happypose | |
run: pip install -e ".[render,evaluation]" | |
- name: Download pre-trained models required for tests | |
run: | | |
mkdir local_data | |
python -m happypose.toolbox.utils.download \ | |
--megapose_models \ | |
--examples \ | |
crackers_example \ | |
--cosypose_models \ | |
detector-bop-ycbv-pbr--970850 \ | |
coarse-bop-ycbv-pbr--724183 \ | |
refiner-bop-ycbv-pbr--604090 | |
- name: Run tests | |
run: | | |
pip install coverage | |
coverage run --source=happypose -m unittest | |
coverage xml | |
- uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |