Skip to content

[Version] Bump version to v0.7.1 #139

[Version] Bump version to v0.7.1

[Version] Bump version to v0.7.1 #139

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches:
- main
paths-ignore:
- "README.md"
- "README_CN.md"
- "docs/**"
pull_request:
paths-ignore:
- "README.md"
- "README_CN.md"
- "docs/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_cpp:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
container:
image: openxrlab/xrprimer_runtime:ubuntu1804_x64_gcc7_py38_torch1121_mmcv170
steps:
- uses: actions/checkout@v2
- name: Show conda env
run: |
source /opt/miniconda/etc/profile.d/conda.sh && conda deactivate
conda info -e
conda activate openxrlab
conda list | grep -e torch -e mmcv
- name: Build and install
run: |
rm -rf xrprimer.egg-info
source /opt/miniconda/etc/profile.d/conda.sh && conda activate openxrlab
conan remote add openxrlab http://conan.openxrlab.org.cn/artifactory/api/conan/openxrlab
cmake -S. -Bbuild_dep -D3RT_FROM_CONAN=ON -G "Ninja"
cmake --build build_dep -j4
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DENABLE_TEST=ON -DCODE_COVERAGE=ON -G "Ninja"
cmake --build build --target install -j4
- name: Prepare test data
run: |
cd build
wget -q https://openxrlab-share-mainland.oss-cn-hangzhou.aliyuncs.com/xrprimer/xrprimer.tar.gz
tar -xzf xrprimer.tar.gz && rm xrprimer.tar.gz
ln -sfn xrprimer/tests tests
- name: Run unittests
run: |
source /opt/miniconda/etc/profile.d/conda.sh && conda activate openxrlab
cd build
./bin/test_calibrator
./bin/test_image
./bin/test_version
./bin/test_pose
./bin/test_camera
PYTHONPATH=./lib python ../cpp/tests/test_multi_camera_calibrator.py
PYTHONPATH=./lib python ../cpp/tests/test_pnpsolver.py
- name: Generate coverage report
run: |
echo "TODO"
# pip install gcovr
# mkdir coverage_html
# coverage_filter="--filter ${CI_PROJECT_DIR}/cpp"
# gcovr ${coverage_filter} -r . --object-directory=${CI_PROJECT_DIR}/build
build_py38:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
container:
image: openxrlab/xrprimer_runtime:ubuntu1804_x64_gcc7_py38_torch1121_mmcv170
env:
GITHUB_ACTIONS: true
steps:
- uses: actions/checkout@v2
- name: Show conda env
run: |
source /opt/miniconda/etc/profile.d/conda.sh && conda deactivate
conda info -e
conda activate openxrlab
conda list | grep -e torch -e mmcv
- name: Build and install
run: |
rm -rf xrprimer.egg-info
source /opt/miniconda/etc/profile.d/conda.sh && conda activate openxrlab
conan remote add openxrlab http://conan.openxrlab.org.cn/artifactory/api/conan/openxrlab
pip install -e .
- name: Prepare test data
run: |
cd python/tests
wget -q https://openxrlab-share-mainland.oss-cn-hangzhou.aliyuncs.com/xrprimer/xrprimer.tar.gz
tar -xzf xrprimer.tar.gz && rm xrprimer.tar.gz
mv xrprimer/tests/data ./
rm -rf xrprimer && cd ../../
- name: Install pytest plugin
run: |
source /opt/miniconda/etc/profile.d/conda.sh && conda activate openxrlab
pip install pytest-github-actions-annotate-failures
- name: Run unittests
run: |
source /opt/miniconda/etc/profile.d/conda.sh && conda activate openxrlab
cd python && coverage run --source xrprimer -m pytest tests/ && cd ..
- name: Generate coverage report
run: |
source /opt/miniconda/etc/profile.d/conda.sh && conda activate openxrlab
cd python && coverage xml && coverage report -m && cd ..
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false