generated from filipdutescu/modern-cpp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (116 loc) · 4.96 KB
/
ubuntu.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
name: Ubuntu
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
env:
build_type: Release
install_location: .local
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v2
- name: cache dependencies
uses: actions/cache@v2
id: cache
with:
path: ${{ github.workspace }}/${{ env.install_location }}
key: ${{ runner.os }}-dependencies-v3
- name: install Catch2
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ..
git clone https://github.com/catchorg/catch2.git --branch v2.13.4
cd catch2
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/${{ env.install_location }} \
-DCATCH_INSTALL_DOCS:BOOL=OFF -DCATCH_INSTALL_EXTRAS:BOOL=OFF -DCATCH_BUILD_TESTING=OFF
cmake --build build --config Release -j4
cmake --build build --target install --config Release
- name: install OpenBLAS
run: sudo apt install -y libopenblas-dev
- name: install OpenCV
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ..
git clone https://github.com/opencv/opencv.git --branch 4.5.0
cd opencv
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/${{ env.install_location }} \
-DBUILD_LIST=videoio,video,core,highgui,imgcodecs,calib3d,dnn,objdetect,features2d \
-DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF \
-DBUILD_opencv_apps:BOOL=OFF \
-DBUILD_FAT_JAVA_LIB:BOOL=OFF -DBUILD_JAVA:BOOL=OFF
cmake --build build --config Release -j4
cmake --build build --target install --config Release
- name: install Caffe dependencies
run: |
sudo apt install -y protobuf-compiler libprotobuf-dev \
libhdf5-dev \
libboost-all-dev \
libgflags-dev libgoogle-glog-dev
- name: install Caffe
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ..
git clone https://github.com/CMU-Perceptual-Computing-Lab/caffe.git
git clone https://aur.archlinux.org/caffe.git caffe-patch
cd caffe
cp -v ../caffe-patch/caffe-1.0-opencv4-fix.patch .
patch -d . -Np1 -i ./caffe-1.0-opencv4-fix.patch || echo "Patch applied"
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/${{ env.install_location }} \
-DBLAS=open \
-DCPU_ONLY=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_docs=OFF \
-DBUILD_python=OFF \
-DBUILD_python_layer=OFF \
-DUSE_LEVELDB=OFF \
-DUSE_LMDB=OFF \
-DUSE_OPENCV=ON
cmake --build build --config Release -j4
cmake --build build --target install --config Release
- name: link Caffe lib to /usr/lib (OpenPose bug)
run: sudo ln -s ${{ github.workspace }}/${{ env.install_location }}/lib/libcaffe.so /usr/lib/libcaffe.so
- name: install OpenPose
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd ..
git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose.git --branch v1.7.0
cd openpose
cp -v ../uavpc/vendor/openpose-opencv4.patch .
patch -d . -Np1 -i ./openpose-opencv4.patch
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/${{ env.install_location }} \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DBUILD_CAFFE:BOOL=OFF \
-DCaffe_INCLUDE_DIRS:PATH=${{ github.workspace }}/${{ env.install_location }}/include \
-DCaffe_LIBS:PATH=${{ github.workspace }}/${{ env.install_location }}/lib/libcaffe.so \
-DGPU_MODE:STRING=CPU_ONLY \
-DDOWNLOAD_BODY_25_MODEL:BOOL=OFF \
-DDOWNLOAD_BODY_MPI_MODEL:BOOL=ON \
-DDOWNLOAD_FACE_MODEL:BOOL=OFF \
-DDOWNLOAD_HAND_MODEL:BOOL=OFF \
-DBUILD_EXAMPLES:BOOL=OFF \
-DBUILD_PYTHON:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=OFF
cmake --build build --config Release -j4
cmake --build build --target install --config Release
- name: install I2C Linux kernel headers
run: sudo apt install -y libi2c-dev
- name: configure
run: |
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/${{ env.install_location }} \
-DCMAKE_BUILD_TYPE:STRING=${{ env.build_type }} \
-Duavpc_ENABLE_CODE_COVERAGE=1 \
-Duavpc_ENABLE_DOXYGEN=0
- name: build
run: cmake --build build --config ${{ env.build_type }} -j4
- name: run tests
run: |
cd build
ctest -C $BUILD_TYPE -VV --output-on-failure -j 8
- name: Code coverage using Codecov
run: bash <(curl -s https://codecov.io/bash)
- name: install project
run: cmake --build build --target install --config ${{ env.build_type }}