Fixed python install #97
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Ubuntu | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-ubuntu: | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
env: | |
# enable starting Qt GUI Applications | |
QT_QPA_PLATFORM: offscreen | |
PROJECT_NAME: ecal | |
steps: | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
if [ "${{ matrix.os }}" == "ubuntu-24.04" ]; then | |
sudo apt-get install ninja-build doxygen graphviz libcurl4-openssl-dev libprotobuf-dev libprotoc-dev protobuf-compiler libhdf5-dev qt6-base-dev qt6-svg-dev libyaml-cpp-dev | |
sudo apt-get -y install python3 python3-venv | |
elif [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then | |
sudo apt-get install ninja-build doxygen graphviz libcurl4-openssl-dev libprotobuf-dev libprotoc-dev protobuf-compiler libhdf5-dev qtbase5-dev libqt5opengl5-dev libqt5svg5-dev libyaml-cpp-dev | |
sudo apt-get -y install python3 python3-venv | |
elif [ "${{ matrix.os }}" == "ubuntu-20.04" ]; then | |
sudo apt-get install ninja-build doxygen graphviz libcurl4-openssl-dev libprotobuf-dev libprotoc-dev protobuf-compiler libhdf5-dev qt5-default libqt5opengl5-dev libqt5svg5-dev libyaml-cpp-dev | |
sudo apt-get -y install python3.9 python3.9-venv | |
fi | |
- name: Set variables | |
run: | | |
if [ "${{ matrix.os }}" == "ubuntu-24.04" ]; then | |
echo "ubuntu_codename=noble" >> "$GITHUB_ENV" | |
echo "python_version=3" >> "$GITHUB_ENV" # => default python 3 version | |
elif [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then | |
echo "ubuntu_codename=focal" >> "$GITHUB_ENV" | |
echo "python_version=3" >> "$GITHUB_ENV" # => default python 3 version | |
elif [ "${{ matrix.os }}" == "ubuntu-20.04" ]; then | |
echo "ubuntu_codename=jammy" >> "$GITHUB_ENV" | |
echo "python_version=3.9" >> "$GITHUB_ENV" | |
fi | |
# Get cpu architecture | |
echo "cpu_architecture=$(dpkg --print-architecture)" >> "$GITHUB_ENV" | |
- name: Install Cap'n Proto | |
run: | | |
mkdir "${{ runner.workspace }}/capnp" | |
cd "${{ runner.workspace }}/capnp" | |
curl -O https://capnproto.org/capnproto-c++-1.0.2.tar.gz | |
tar zxf capnproto-c++-1.0.2.tar.gz | |
cd capnproto-c++-1.0.2 | |
./configure | |
make -j | |
sudo make install | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
- name: Install Python requirements | |
shell: bash | |
run: | | |
mkdir ".venv_build" | |
python${{ env.python_version }} -m venv ".venv_build" | |
source ".venv_build/bin/activate" | |
pip install --upgrade pip | |
pip install wheel setuptools | |
pip install -r "$GITHUB_WORKSPACE/doc/requirements.txt" | |
- name: CMake | |
run: | | |
source ".venv_build/bin/activate" | |
mkdir "${{ runner.workspace }}/_build" | |
cd "${{ runner.workspace }}/_build" | |
cmake $GITHUB_WORKSPACE -G "Ninja" \ | |
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | |
-DHAS_HDF5=ON \ | |
-DHAS_QT=ON \ | |
-DHAS_CURL=ON \ | |
-DHAS_CAPNPROTO=ON \ | |
-DHAS_FTXUI=ON \ | |
-DBUILD_DOCS=ON \ | |
-DBUILD_APPS=ON \ | |
-DBUILD_SAMPLES=ON \ | |
-DBUILD_TIME=ON \ | |
-DBUILD_PY_BINDING=OFF \ | |
-DBUILD_STANDALONE_PY_WHEEL=OFF \ | |
-DBUILD_CSHARP_BINDING=OFF \ | |
-DBUILD_ECAL_TESTS=ON \ | |
-DECAL_INCLUDE_PY_SAMPLES=OFF \ | |
-DECAL_INSTALL_SAMPLE_SOURCES=ON \ | |
-DECAL_JOIN_MULTICAST_TWICE=OFF \ | |
-DECAL_NPCAP_SUPPORT=OFF \ | |
-DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \ | |
-DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \ | |
-DECAL_THIRDPARTY_BUILD_SPDLOG=ON \ | |
-DECAL_THIRDPARTY_BUILD_TINYXML2=ON \ | |
-DECAL_THIRDPARTY_BUILD_FINEFTP=ON \ | |
-DECAL_THIRDPARTY_BUILD_CURL=OFF \ | |
-DECAL_THIRDPARTY_BUILD_GTEST=ON \ | |
-DECAL_THIRDPARTY_BUILD_HDF5=OFF \ | |
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON \ | |
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON \ | |
-DECAL_THIRDPARTY_BUILD_QWT=ON \ | |
-DECAL_THIRDPARTY_BUILD_YAML-CPP=OFF \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_SYSCONFDIR=/etc \ | |
-DCMAKE_INSTALL_PREFIX=/usr \ | |
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \ | |
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu \ | |
-DPython_FIND_VIRTUALENV=ONLY | |
sudo mkdir /etc/ecal | |
sudo cp "$GITHUB_WORKSPACE/ecal/core/cfg/ecal.ini" /etc/ecal | |
shell: bash | |
- name: Build Release | |
run: cmake --build . --config Release -- -k 0 | |
working-directory: ${{ runner.workspace }}/_build | |
- name: Run Tests | |
run: ctest -V | |
working-directory: ${{ runner.workspace }}/_build | |
- name: Read Project Version from CMakeCache | |
run: | | |
cmake_project_version_string=$(cat "${{github.workspace}}/_build/CMakeCache.txt" | grep "^CMAKE_PROJECT_VERSION:") | |
arr=(${cmake_project_version_string//=/ }) | |
cmake_project_version=${arr[1]} | |
echo "CMAKE_PROJECT_VERSION=$cmake_project_version" >> "$GITHUB_ENV" | |
shell: bash | |
- name: CPack | |
run: cpack -G DEB | |
working-directory: ${{ runner.workspace }}/_build | |
- name: Rename .deb installer | |
run: | | |
mv *.deb '${{ env.PROJECT_NAME }}_${{ env.CMAKE_PROJECT_VERSION }}-${{ env.ubuntu_codename }}_${{ env.cpu_architecture }}.deb' | |
shell: bash | |
working-directory: ${{github.workspace}}/_build/_deploy/ | |
- name: Upload Debian | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ubuntu-debian | |
path: ${{ runner.workspace }}/_build/_deploy/*.deb |