-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (112 loc) · 3.55 KB
/
build.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
name: Build
on:
push:
branches: [ main ]
# Allow manual triggering
workflow_dispatch:
env:
PHASE_VERSION: v0.3.0
PHASE_REPO: i3drobotics/phase
jobs:
# Build / test
build-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
# Setup python
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Install Phase
- name: Download Phase
shell: bash
run: |
curl --output phase-${{ env.PHASE_VERSION }}-${{ matrix.os }}-x86_64.tar.gz -L https://github.com/i3drobotics/phase/releases/download/${{ env.PHASE_VERSION }}/phase-${{ env.PHASE_VERSION }}-${{ matrix.os }}-x86_64.tar.gz
- name: Install Phase
shell: bash
run: |
mkdir phase_install
tar -xf phase-${{ env.PHASE_VERSION }}-${{ matrix.os }}-x86_64.tar.gz -C ./phase_install
sudo apt update
sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt install -y libgl-dev liblapack-dev libblas-dev libgtk2.0-dev
sudo apt install -y libgstreamer1.0-0 libgstreamer-plugins-base1.0-0
sudo apt install -y zlib1g libstdc++6
sudo apt install -y libc6 libgcc1
sudo apt install -y patchelf
# Install python packages
- name: Python requirements
shell: bash
run: |
pip install -r requirements.txt
# Build
- name: Build
shell: bash
run: |
mkdir -p build && cd build
sudo apt-get update && cmake -DPhase_DIR="./phase_install/lib/cmake" ..
make -j$(nproc)
# Unit Test
- name: Unit Test
shell: bash
run: |
cd build/lib
python3 -m pytest ../../test/unit/
# Performance Test
- name: Perf Test
shell: bash
run: |
cd build/lib
python3 -m pytest ../../test/perf/
# Build / test
build-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
# Setup python
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Install Phase
- name: Download Phase
shell: bash
run: |
curl --output phase-${{ env.PHASE_VERSION }}-windows-x86_64.zip -L https://github.com/i3drobotics/phase/releases/download/${{ env.PHASE_VERSION }}/phase-${{ env.PHASE_VERSION }}-windows-x86_64.zip
- name: Install Phase
shell: powershell
run: |
Expand-Archive -Path phase-${{ env.PHASE_VERSION }}-windows-x86_64.zip -DestinationPath phase_install
# Install python packages
- name: Python requirements
shell: bash
run: |
pip install -r requirements.txt
# Build
- name: Build
shell: bash
run: |
mkdir -p build && cd build
cmake -G "Visual Studio 16 2019" -A x64 -DPhase_DIR="./phase_install/lib/cmake" ..
cmake --build . --config Release
# Unit Test
- name: Unit Test
shell: bash
run: |
cd build/lib
python3 -m pytest ../../test/unit/
# Performance Test
- name: Perf Test
shell: bash
run: |
cd build/lib
python3 -m pytest ../../test/perf/