-
Notifications
You must be signed in to change notification settings - Fork 10
72 lines (63 loc) · 2.1 KB
/
conda-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Tests with conda
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@v3
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 and data
uses: actions/cache@v4
with:
path: |
${{ env.CONDA }}/envs
local_data
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 .
- name: Download pre-trained models required for tests
run: |
mkdir -p local_data
python -m happypose.toolbox.utils.download \
--megapose_models \
--examples \
barbecue-sauce \
--cosypose_models \
detector-bop-hope-pbr--15246 \
coarse-bop-hope-pbr--225203 \
refiner-bop-hope-pbr--955392
- name: Run tests
run: |
python -m unittest
pytest