Skip to content

Commit

Permalink
improvement: added test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
BartSte committed Jan 1, 2024
1 parent 3e2b24a commit e8f2a29
Show file tree
Hide file tree
Showing 10 changed files with 2,993 additions and 8 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Tests

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Update apt-get database
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
- name: Install build dependencies
run: sudo apt-get install -y clang ninja-build git cmake

- name: Install Qt dependencies
run: |
sudo apt-get -y install build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libvulkan-dev libxkbcommon-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
- name: Install project dependencies
run: sudo apt-get install -y libboost-all-dev libspdlog-dev qt6-base-dev qt6-multimedia-dev

- name: Build project
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake --build build
- name: Run tests
env:
QT_MEDIA_BACKEND: ffmpeg
run: ctest --test-dir ./build --verbose
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option(BUILD_TESTS "Build tests" OFF)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Build tests: ${BUILD_TESTS}")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
Expand Down
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Ensure the following dependencies are installed:
| Dependency | Version |
| ------------------------------------------------------------- | -------- |
| [Qt6](https://www.qt.io/download): base & multimedia (ffmpeg) | ≥ 6.6.0 |
| [cxxopts](https://github.com/jarro2783/cxxopts) | ≥ 3.1.1 |
| [boost](https://www.boost.org/) | ≥ 1.83 |
| [spdlog](https://github.com/gabime/spdlog) | ≥ 1.12.0 |

Expand All @@ -68,6 +67,10 @@ For building the project, the following dependencies are required:
- [CMake](https://cmake.org/download/)
- [Ninja](https://ninja-build.org/)

`cxxopts` and `googletest` are also dependencies, but they are included in the
project. The former as a header file in the `extern` directory, and the latter
is installed using `cmake`.

## Installation

The following sections explain how to install the project. You have two
Expand Down Expand Up @@ -362,6 +365,55 @@ more information.

# TODO:

- [ ] test pipeline:

- I get the following error when running the tests in a github workflow using
ubuntu-latest:
```bash
qt.multimedia.player: Warning: "No decoder available for type 'video/quicktime, variant=(string)iso'."
```
I tried the following:
- Set the QT_MEDIA_BACKEND to ffmpeg as the website suggests this is more
stable.
- Install all qt6 multimedia packages I could find.

Interesting is that I get the same error when when I set the QT_MEDIA_BACKEND
to gstreamer on my Arch Linux machine. I was able to fix this partially by
installing many gstreamer packages. However, I want ffmpeg so switching to
gstreamer is not an option (it is also not recommended by the qt website).

[Here](https://stackoverflow.com/questions/75025298/qt6-qtmultimedia-ffmpeg-backend-preview-procedure)
I found that Qt 6.4 uses ffmpeg as the backend. Ubuntu uses 6.2. So I think
upgrading to 6.4 + setting the QT_MEDIA_BACKEND to ffmpeg should fix the
issue.

Upgrading to 6.4 on Ubuntu cannot be done through a package manager. So I
have the following options:

- Use a PPA that has supplies Qt 6.4 (cannot find one).
- Build from source (takes a long time).
- Use the qt installer with cli (takes a long time, but less than building
from source).

- I used the following command to install Qt 6.6.1 for linux:

```bash
qt-unified-linux-x64-4.6.1-online.run --email <email> --pw <pw> --root ~/installation_dir --accept-licenses --accept-obligations --default-answer --confirm-command install qt.qt6.661.gcc_64
```

Instead of passing the pw and email, you can also set an environment
variable with a token.

Next make sure that cmake uses this installation by setting the following
environment variables:

```bash
....
```


- Use a docker image that has Qt 6.4.

- [ ] Add pre built binaries to the github releases
- [ ] Add an uninstall target?
- [ ] Cross compile for raspberry pi
Loading

0 comments on commit e8f2a29

Please sign in to comment.