-
Notifications
You must be signed in to change notification settings - Fork 427
190 lines (179 loc) · 6.9 KB
/
install_and_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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Install and test
on:
pull_request: {}
push:
branches:
- main
jobs:
python_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Setup python
uses: actions/[email protected]
with:
python-version: '3.9.16'
- name: setup
run: |-
pip install -U pip
pip install -U --prefer-binary \
black==23.1.0 \
flake8 \
flake8-bugbear==22.6.22 \
flake8-builtins \
flake8-comprehensions \
flake8-return \
flake8-simplify \
hypothesis==6.29.3 \
isort==5.12.0 \
mypy \
numpy==1.26.4 \
pytest \
sphinx \
tqdm
pip install --prefer-binary -r requirements.txt torch --progress-bar off
- name: run black
run: |-
black --version
black --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)|examples/tutorials/(notebooks|nb_python)' src_python/habitat_sim/. examples/. tests/. setup.py --diff
black --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)|examples/tutorials/(notebooks|nb_python)' src_python/habitat_sim/. examples/. tests/. setup.py --check
- name: run isort
run: |-
isort --version
isort src_python/habitat_sim/. examples/. tests/. setup.py --diff
isort src_python/habitat_sim/. examples/. tests/. setup.py --check-only
- name: run flake8
run: |-
flake8 --version
flake8 src_python/habitat_sim/. examples/. tests/. setup.py
- name: run mypy
run: mypy
install_and_test_ubuntu:
runs-on: 4-core-ubuntu-gpu-t4
env:
FPS_THRESHOLD: 900
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/[email protected]
with:
path: "./habitat-sim"
- name: CPU info
run: cat /proc/cpuinfo
- uses: "./habitat-sim/.github/actions/install_ubuntu_deps"
- uses: "./habitat-sim/.github/actions/install_ubuntu_gpu_deps"
- name: Build, install habitat-sim
run: |-
#give cmake ownership to the runner for installation
sudo chown runner -R /opt/cmake312/
#activate conda env
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda init
source ~/.bashrc
conda activate habitat
#install habitat-sim
cd habitat-sim
pip install -r requirements.txt --progress-bar off
git submodule update --init --recursive --jobs 8
python -u setup.py install --build-type "Release" --lto --headless --bullet
- name: Download test data
run: |-
# Disable clone protection for git lfs
export GIT_CLONE_PROTECTION_ACTIVE=false
git --version
git-lfs --version
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda init
source ~/.bashrc
conda activate habitat
conda install -y gitpython git-lfs
cd habitat-sim
git lfs install
python src_python/habitat_sim/utils/datasets_download.py --uids ci_test_assets ycb rearrange_dataset_v2 --replace --data-path data/ --no-prune
ls -la data/scene_datasets/habitat-test-scenes/
- name: Run sim benchmark
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda init
source ~/.bashrc
conda activate habitat
cd habitat-sim
python examples/example.py --scene data/scene_datasets/habitat-test-scenes/van-gogh-room.glb --silent --test_fps_regression $FPS_THRESHOLD
- name: Debugging with tmate
uses: mxschmitt/[email protected]
- name: Run sim tests
run: |-
#give cmake ownership to the runner for installation
sudo chown runner -R /opt/cmake312/
#activate conda env
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda init
source ~/.bashrc
conda activate habitat
cd habitat-sim
export PYTHONPATH=$(pwd):$PYTHONPATH
#set pytest to show partial progress
export PYTHONUNBUFFERED=1
# run tests with code coverage
CORRADE_TEST_COLOR=ON GTEST_COLOR=yes ./build.sh --headless \
--bullet \
--with-cuda \
--build-datatool \
--run-tests \
--no-lto \
--cmake-args='-DCMAKE_CXX_FLAGS="--coverage"'
PYTHONPATH=src_python pytest -n 4 --durations=10 --cov-report=xml --cov=./
#run the marked pytest-benchmark tests and print the results
PYTHONPATH=src_python pytest -m sim_benchmarks
#re-build without bullet and cuda and run physics tests again
#TODO: instead of reinstall, do this with configuration
./build.sh --headless --cmake-args='-DCMAKE_CXX_FLAGS="--coverage"'
PYTHONPATH=src_python pytest -n 4 --durations=10 --cov-report=xml --cov=./ --cov-append tests/test_physics.py tests/test_sensors.py
- name: upload test coverage
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda init
source ~/.bashrc
conda activate habitat
cd habitat-sim
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
#Uploading test coverage for Python code
./codecov -f coverage.xml -cF Python
#Uploading test coverage for C++ code
lcov --directory . --capture --output-file coverage.info
# Replaces -1 linecount with zero to prevent lcov from crashing:
# https://github.com/psycofdj/coverxygen/issues/6
sed -i -e 's/,-1$/,0/g' coverage.info
#lcov --remove coverage.info "*/deps/*" --output-file coverage.info > /dev/null
#lcov --remove coverage.info "*/test/*" --output-file coverage.info > /dev/null
#lcov --remove coverage.info "*/tests/*" --output-file coverage.info > /dev/null
./codecov -f coverage.info -cF CPP
install_and_test_ubuntu_audio:
runs-on: 4-core-ubuntu-gpu-t4
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/[email protected]
with:
path: "./habitat-sim"
- name: CPU info
run: cat /proc/cpuinfo
- uses: "./habitat-sim/.github/actions/install_ubuntu_deps"
- uses: "./habitat-sim/.github/actions/install_ubuntu_gpu_deps"
- name: install habitat-sim with audio and run audio_agent script
run: |-
#give cmake ownership to the runner for installation
sudo chown runner -R /opt/cmake312/
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda init
source ~/.bashrc
conda activate habitat
cd habitat-sim
pip install -r requirements.txt --progress-bar off
pip install imageio imageio-ffmpeg
git submodule update --init --recursive --jobs 8
python -u setup.py install --build-type "Release" --lto --headless --audio
python examples/tutorials/audio_agent.py