-
Notifications
You must be signed in to change notification settings - Fork 7
135 lines (119 loc) · 5.11 KB
/
python-package.yml
File metadata and controls
135 lines (119 loc) · 5.11 KB
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
# SPDX-FileCopyrightText: 2021 Gabriel J. Schwarzkopf <sispo-devs@outlook.com>
#
# SPDX-License-Identifier: GPL-3.0-or-later
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Create Python Package
on:
pull_request:
workflow_dispatch:
jobs:
build_check:
runs-on: ubuntu-latest
env:
BLENDER_VERSION: 2.92
PYTHON_VERSION: 3.7
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '${{ env.PYTHON_VERSION }}'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install conda dependencies
run: |
conda update -n base -c defaults conda
conda env update --file environment.yml --name base
conda install setuptools wheel twine
- name: Build and check
run: |
python setup.py sdist bdist_wheel
twine check dist/*
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1.1
- name: Cache compiled dependencies
id: cache
uses: actions/cache@v2.1.4
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: |
software/star_cats/build_star_cats
software/openMVG/build_openMVG
software/openMVS/build_openMVS
/usr/share/miniconda/lib/python${{ env.PYTHON_VERSION }}/site-packages/${{ env.BLENDER_VERSION }}
/usr/share/miniconda/lib/python${{ env.PYTHON_VERSION }}/site-packages/bpy.so
# An explicit key for restoring and saving the cache
key: compiled-deps
- name: Build star_cats
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd software
git clone --depth 1 https://github.com/Bill-Gray/star_cats.git
cd star_cats
[[ -d build_star_cats ]] || mkdir build_star_cats
make all
cp u4test build_star_cats/
cd ../..
- name: Build bpy
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt update
sudo apt install -y build-essential git subversion cmake libx11-dev libxxf86vm-dev libxcursor-dev libxi-dev libxrandr-dev libxinerama-dev libglew-dev
cd software
mkdir blender && cd blender
git clone --depth 1 --recursive --branch v$BLENDER_VERSION.0 https://git.blender.org/blender.git
mkdir lib && cd lib
svn checkout https://svn.blender.org/svnroot/bf-blender/tags/blender-$BLENDER_VERSION-release/lib/linux_centos7_x86_64/
cd ..
cd blender
make bpy
cd ../build_linux_bpy
make install
echo "Successful compilation"
cp ../lib/linux_centos7_x86_64/python/lib/python$PYTHON_VERSION/site-packages/bpy.so /usr/share/miniconda/lib/python$PYTHON_VERSION/site-packages/
cp -r ../lib/linux_centos7_x86_64/python/lib/python$PYTHON_VERSION/site-packages/$BLENDER_VERSION /usr/share/miniconda/lib/python$PYTHON_VERSION/site-packages/
echo "Successful copying"
python -c "import bpy; bpy.ops.wm.save_as_mainfile(filepath='./my.blend')"
cd ../..
- name: Build openMVG
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt update
sudo apt install -y build-essential cmake libpng-dev libjpeg8-dev libtiff-dev libxxf86vm1 libxxf86vm-dev x11proto-xf86vidmode-dev libxrandr-dev
cd software
mkdir openMVG && cd openMVG
[[ -d build_openMVG ]] || mkdir build_openMVG
git clone --depth 1 --recursive https://github.com/openMVG/openMVG.git
cd build_openMVG
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=install . ../openMVG/src
cmake --build . --target install
cd ../..
- name: Build openMVS
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt update
sudo apt install -y build-essential cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev libopencv-dev libcgal-dev libcgal-qt5-dev
cd software
mkdir openMVS && cd openMVS
git clone --depth 1 --branch 3.2 https://gitlab.com/libeigen/eigen.git
mkdir eigen_build && cd eigen_build
cmake . ../eigen
make && sudo make install
cd ..
git clone --depth 1 https://github.com/cdcseacave/VCG.git vcglib
git clone --depth 1 https://github.com/cdcseacave/openMVS.git openMVS
mkdir openMVS_build && cd openMVS_build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DVCG_ROOT="../vcglib" . ../openMVS
cmake --build . --target install
cd ../..
- name: Test sispo
run: |
mkdir data/UCAC4
python -c "import sispo"
echo "Import successful"
- name: sispo unittests
run: |
python test_basics.py