2020-12-26 23:40:47 +01:00
|
|
|
---
|
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2022-06-14 14:48:21 +02:00
|
|
|
workflow_dispatch:
|
2023-07-29 13:02:43 +02:00
|
|
|
merge_group:
|
2020-12-26 23:40:47 +01:00
|
|
|
|
2022-05-07 17:22:39 +02:00
|
|
|
env:
|
2023-01-31 12:33:17 +01:00
|
|
|
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.6
|
2023-06-24 15:03:27 +02:00
|
|
|
QT_QPA_PLATFORM: minimal
|
2022-05-07 17:22:39 +02:00
|
|
|
|
2023-01-15 17:27:41 +01:00
|
|
|
concurrency:
|
2022-05-21 11:33:21 +02:00
|
|
|
group: test-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-12-26 23:40:47 +01:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-06-24 23:48:29 +02:00
|
|
|
include:
|
2023-08-27 13:11:59 +02:00
|
|
|
- os: "ubuntu-22.04"
|
2023-06-24 23:48:29 +02:00
|
|
|
qt-version: "5.15.2"
|
2023-08-27 13:11:59 +02:00
|
|
|
- os: "ubuntu-22.04"
|
2023-06-24 23:48:29 +02:00
|
|
|
qt-version: "5.12.12"
|
|
|
|
- os: "ubuntu-22.04"
|
|
|
|
qt-version: "6.2.4"
|
2020-12-26 23:40:47 +01:00
|
|
|
fail-fast: false
|
2023-07-29 13:02:43 +02:00
|
|
|
env:
|
|
|
|
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }}
|
|
|
|
QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }}
|
2020-12-26 23:40:47 +01:00
|
|
|
|
|
|
|
steps:
|
2023-09-09 15:31:12 +02:00
|
|
|
- uses: actions/checkout@v4
|
2020-12-26 23:40:47 +01:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2023-07-29 13:02:43 +02:00
|
|
|
- name: Install Qt
|
2023-08-07 11:00:33 +02:00
|
|
|
uses: jurplel/install-qt-action@v3.3.0
|
2020-12-26 23:40:47 +01:00
|
|
|
with:
|
2022-11-03 20:03:16 +01:00
|
|
|
cache: true
|
2023-06-24 23:48:29 +02:00
|
|
|
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
|
2023-07-29 13:02:43 +02:00
|
|
|
modules: ${{ env.QT_MODULES }}
|
2022-06-14 14:48:21 +02:00
|
|
|
version: ${{ matrix.qt-version }}
|
2020-12-26 23:40:47 +01:00
|
|
|
|
2023-08-27 13:11:59 +02:00
|
|
|
- name: Apply Qt patches (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.qt-version, '5.')
|
|
|
|
run: |
|
|
|
|
patch "$Qt5_DIR/include/QtConcurrent/qtconcurrentthreadengine.h" .patches/qt5-on-newer-gcc.patch
|
|
|
|
shell: bash
|
|
|
|
|
2020-12-26 23:40:47 +01:00
|
|
|
# LINUX
|
|
|
|
- name: Install dependencies (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2023-01-15 17:27:41 +01:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install \
|
|
|
|
cmake \
|
|
|
|
rapidjson-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libboost-dev \
|
|
|
|
libboost-system-dev \
|
|
|
|
libboost-filesystem-dev \
|
|
|
|
libpulse-dev \
|
|
|
|
libxkbcommon-x11-0 \
|
|
|
|
libgstreamer-plugins-base1.0-0 \
|
|
|
|
build-essential \
|
|
|
|
libgl1-mesa-dev \
|
|
|
|
libxcb-icccm4 \
|
|
|
|
libxcb-image0 \
|
|
|
|
libxcb-keysyms1 \
|
|
|
|
libxcb-render-util0 \
|
|
|
|
libxcb-xinerama0
|
2020-12-26 23:40:47 +01:00
|
|
|
|
|
|
|
- name: Create build directory (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2023-01-15 17:27:41 +01:00
|
|
|
mkdir build-test
|
2020-12-26 23:40:47 +01:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Build (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2023-06-24 23:48:29 +02:00
|
|
|
cmake \
|
|
|
|
-DBUILD_TESTS=On \
|
|
|
|
-DBUILD_APP=OFF \
|
|
|
|
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
|
|
|
|
..
|
2023-06-24 15:03:27 +02:00
|
|
|
cmake --build .
|
2020-12-26 23:40:47 +01:00
|
|
|
working-directory: build-test
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Test (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2023-07-29 11:49:44 +02:00
|
|
|
timeout-minutes: 30
|
2020-12-26 23:40:47 +01:00
|
|
|
run: |
|
2023-01-15 17:27:41 +01:00
|
|
|
docker pull kennethreitz/httpbin
|
|
|
|
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
|
|
|
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
|
|
|
docker run -p 9051:80 --detach kennethreitz/httpbin
|
2023-10-13 17:41:23 +02:00
|
|
|
ctest --repeat until-pass:4
|
2020-12-26 23:40:47 +01:00
|
|
|
working-directory: build-test
|
|
|
|
shell: bash
|