Skip to content

feature/MV 1829 Use OpenEB Dockerfile to build and test on GitHubActions #254

feature/MV 1829 Use OpenEB Dockerfile to build and test on GitHubActions

feature/MV 1829 Use OpenEB Dockerfile to build and test on GitHubActions #254

Workflow file for this run

name: All Build
on:
workflow_dispatch:
pull_request:
env:
#General variables
numpy_version: "numpy==1.23.4" # replace with only 'numpy' if no version needed
python_versions: 3.8
pybind_version: "2.6.0"
#Windows variables
python_executable: "C:/hostedtoolcache/windows/Python/3.8.10/x64/python.exe" #Cmake needs this to find python on windows
jobs:
container-test-job:
name: test
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.PSEE_DOCKER_HUB_USER }}
password: ${{ secrets.PSEE_DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push Docker image
uses: docker/build-push-action@v5
with:
context:
file: .github/workflows/Dockerfile.OpenEB
push: true
tags: prophesee/openeb:openeb-ubuntu-20.04
job1:
name: Ubuntu 20
needs: container-test-job
runs-on: ubuntu-20.04
container:
image: openeb:ubuntu-20.04
steps:
- name: Build openEB
run: |
mkdir build && cd build
cmake .. -DBUILD_TESTING=ON
cmake --build . --config Release --parallel 4
- name: Getting datasets from storage
uses: dawidd6/action-download-artifact@v2
with:
workflow: upload_datasets.yaml
workflow_conclusion: success
name: datasets
path: datasets
- name: Run ctest
run: |
cd build
ctest --output-on-failure
job2:
name: Ubuntu 22
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get -y update && sudo apt-get install -y sudo apt-utils wget cmake build-essential \
libglew-dev git g++ libusb-1.0-0-dev libgtest-dev libgmock-dev libssl-dev \
python3-pip python3-distutils xvfb libglfw3 libglfw3-dev libglew-dev libopencv-dev ffmpeg \
libboost-dev libboost-program-options-dev libboost-filesystem-dev libboost-timer-dev \
libprotobuf-dev protobuf-compiler \
libboost-chrono-dev libboost-thread-dev zip unzip git-lfs libhdf5-dev hdf5-tools
pip install $numpy_version pytest opencv-python==4.5.5.64 torch==1.13.1 scipy sk-video==1.1.10 numba==0.56.3 h5py protobuf==3.20.3 command_runner kornia==0.6.8 pytorch_lightning==1.8.6 pytorch_msssim==0.2.1
- name: Build pybind and gtest
run: |
openebfolder=${PWD}
cd ..
wget https://github.com/pybind/pybind11/archive/v$pybind_version.zip
unzip v$pybind_version.zip
cd pybind11-$pybind_version/
mkdir build && cd build
cmake .. -DPYBIND11_TEST=OFF
cmake --build . --config Release --parallel 4
sudo make install
- name: Build openEB
run: |
mkdir build && cd build
cmake .. -DBUILD_TESTING=ON
cmake --build . --config Release --parallel 4
- name: Getting datasets from storage
uses: dawidd6/action-download-artifact@v2
with:
workflow: upload_datasets.yaml
workflow_conclusion: success
name: datasets
path: datasets
- name: Run ctest
run: |
cd build
ctest --output-on-failure
job3:
name: Windows
runs-on: windows-2019
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ env.python_versions }}
- name: Download vcpkg binaries
uses: dawidd6/action-download-artifact@v2
with:
workflow: upload_win_binaries.yaml
workflow_conclusion: success
name: vcpkg_binaries
path: ".."
- name: Download ffmpeg archive
uses: dawidd6/action-download-artifact@v2
with:
workflow: upload_win_binaries.yaml
workflow_conclusion: success
name: ffmpeg_archive
path: ".."
- name: Install build and tests dependencies
shell: bash
run: |
cd ..
unzip -q "vcpkg-export.zip"
7z x ffmpeg-archive.7z
$python_executable -m pip install pytest $numpy_version opencv-python==4.5.5.64 torch==1.13.1 scipy sk-video==1.1.10 numba==0.56.3 h5py command_runner kornia==0.6.8 pytorch_lightning==1.8.6 pytorch_msssim==0.2.1
cd openeb
- name: Build openEB
shell: bash
run: |
export PATH=$PATH:`realpath ../ffmpeg-*-full_build/bin`
mkdir build && cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE="../cmake/toolchains/vcpkg.cmake" \
-DVCPKG_DIRECTORY=`realpath ../../vcpkg` \
-D Python3_EXECUTABLE=$python_executable \
-DBUILD_TESTING=ON ..
cmake --build . --config Release --parallel 4
- name: Getting datasets from storage
uses: dawidd6/action-download-artifact@v2
with:
workflow: upload_datasets.yaml
workflow_conclusion: success
name: datasets
path: datasets
- name: Ctest suite
shell: powershell
run: |
cd build
ctest -C Release --output-on-failure