mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
chore: Run Ubuntu tests in Docker (#5170)
Co-authored-by: Wissididom <30803034+Wissididom@users.noreply.github.com>
This commit is contained in:
parent
e3c9c13598
commit
fe1e498a5f
6 changed files with 73 additions and 63 deletions
|
@ -13,11 +13,15 @@ cmake \
|
||||||
-B build \
|
-B build \
|
||||||
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
|
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DBUILD_APP=On \
|
||||||
|
-DBUILD_TESTS=On \
|
||||||
|
-DBUILD_BENCHMARKS=On \
|
||||||
-DUSE_PRECOMPILED_HEADERS=OFF \
|
-DUSE_PRECOMPILED_HEADERS=OFF \
|
||||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
|
||||||
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
|
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
|
||||||
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
|
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
|
||||||
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
|
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
|
||||||
|
-DCHATTERINO_STATIC_QT_BUILD=On \
|
||||||
-DCMAKE_CXX_FLAGS="-fno-sized-deallocation" \
|
-DCMAKE_CXX_FLAGS="-fno-sized-deallocation" \
|
||||||
.
|
.
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
102
.github/workflows/test.yml
vendored
102
.github/workflows/test.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
name: Test
|
name: Test Ubuntu
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -7,7 +7,7 @@ on:
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.6
|
TWITCH_PUBSUB_SERVER_TAG: v1.0.7
|
||||||
QT_QPA_PLATFORM: minimal
|
QT_QPA_PLATFORM: minimal
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
@ -16,91 +16,71 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
name: "${{ matrix.os }}"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ${{ matrix.container }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: "ubuntu-22.04"
|
- os: "ubuntu-22.04"
|
||||||
qt-version: "5.15.2"
|
container: ghcr.io/chatterino/chatterino2-build-ubuntu-22.04:latest
|
||||||
- os: "ubuntu-22.04"
|
qt-version: 6.6.1
|
||||||
qt-version: "5.12.12"
|
plugins: true
|
||||||
- os: "ubuntu-22.04"
|
|
||||||
qt-version: "6.2.4"
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
env:
|
env:
|
||||||
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }}
|
C2_PLUGINS: ${{ matrix.plugins }}
|
||||||
QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }}
|
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install Qt
|
|
||||||
uses: jurplel/install-qt-action@v3.3.0
|
|
||||||
with:
|
|
||||||
cache: true
|
|
||||||
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
|
|
||||||
modules: ${{ env.QT_MODULES }}
|
|
||||||
version: ${{ matrix.qt-version }}
|
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
# LINUX
|
|
||||||
- name: Install dependencies (Ubuntu)
|
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get -y install \
|
|
||||||
libbenchmark-dev \
|
|
||||||
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
|
|
||||||
|
|
||||||
- name: Create build directory (Ubuntu)
|
- name: Create build directory (Ubuntu)
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
run: mkdir build-test
|
||||||
|
|
||||||
|
- name: Install googlebench
|
||||||
run: |
|
run: |
|
||||||
mkdir build-test
|
sudo apt update
|
||||||
shell: bash
|
sudo apt -y install \
|
||||||
|
libbenchmark-dev
|
||||||
|
|
||||||
- name: Build (Ubuntu)
|
- name: Build (Ubuntu)
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
run: |
|
run: |
|
||||||
cmake \
|
cmake \
|
||||||
-DBUILD_TESTS=On \
|
-DBUILD_TESTS=On \
|
||||||
-DBUILD_BENCHMARKS=On \
|
-DBUILD_BENCHMARKS=On \
|
||||||
-DBUILD_APP=OFF \
|
-DBUILD_APP=OFF \
|
||||||
|
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
|
||||||
|
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
|
||||||
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
|
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
|
||||||
|
-DCHATTERINO_STATIC_QT_BUILD=On \
|
||||||
..
|
..
|
||||||
cmake --build .
|
cmake --build .
|
||||||
working-directory: build-test
|
working-directory: build-test
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Test (Ubuntu)
|
- name: Download and extract Twitch PubSub Server Test
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
run: |
|
||||||
|
mkdir pubsub-server-test
|
||||||
|
curl -L -o pubsub-server.tar.gz "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/server-${{ env.TWITCH_PUBSUB_SERVER_TAG }}-linux-amd64.tar.gz"
|
||||||
|
tar -xzf pubsub-server.tar.gz -C pubsub-server-test
|
||||||
|
rm pubsub-server.tar.gz
|
||||||
|
cd pubsub-server-test
|
||||||
|
curl -L -o server.crt "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt"
|
||||||
|
curl -L -o server.key "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key"
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: Cargo Install httpbox
|
||||||
|
run: |
|
||||||
|
cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f
|
||||||
|
|
||||||
|
- name: Test
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
run: |
|
run: |
|
||||||
docker pull kennethreitz/httpbin
|
httpbox --port 9051 &
|
||||||
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
cd ../pubsub-server-test
|
||||||
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
./server 127.0.0.1:9050 &
|
||||||
docker run -p 9051:80 --detach kennethreitz/httpbin
|
cd ../build-test
|
||||||
ctest --repeat until-pass:4 --output-on-failure
|
ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering
|
||||||
working-directory: build-test
|
working-directory: build-test
|
||||||
shell: bash
|
|
||||||
|
|
|
@ -32,3 +32,10 @@ set_target_properties(${PROJECT_NAME}
|
||||||
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin"
|
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin"
|
||||||
AUTORCC ON
|
AUTORCC ON
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (CHATTERINO_STATIC_QT_BUILD)
|
||||||
|
qt_import_plugins(${PROJECT_NAME} INCLUDE_BY_TYPE
|
||||||
|
platforms Qt::QXcbIntegrationPlugin
|
||||||
|
Qt::QMinimalIntegrationPlugin
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
|
@ -186,6 +186,15 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CHATTERINO_HAVE_PLUGINS
|
||||||
|
PluginController *getPlugins() override
|
||||||
|
{
|
||||||
|
assert(false && "EmptyApplication::getPlugins was called without "
|
||||||
|
"being initialized");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Updates &getUpdates() override
|
Updates &getUpdates() override
|
||||||
{
|
{
|
||||||
return this->updates_;
|
return this->updates_;
|
||||||
|
|
|
@ -728,7 +728,7 @@ add_library(${LIBRARY_PROJECT} OBJECT ${SOURCE_FILES})
|
||||||
|
|
||||||
if(CHATTERINO_PLUGINS)
|
if(CHATTERINO_PLUGINS)
|
||||||
target_compile_definitions(${LIBRARY_PROJECT}
|
target_compile_definitions(${LIBRARY_PROJECT}
|
||||||
PRIVATE
|
PUBLIC
|
||||||
CHATTERINO_HAVE_PLUGINS
|
CHATTERINO_HAVE_PLUGINS
|
||||||
)
|
)
|
||||||
message(STATUS "Building Chatterino with lua plugin support enabled.")
|
message(STATUS "Building Chatterino with lua plugin support enabled.")
|
||||||
|
@ -814,7 +814,10 @@ if (BUILD_APP)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CHATTERINO_STATIC_QT_BUILD)
|
if (CHATTERINO_STATIC_QT_BUILD)
|
||||||
qt_import_plugins(${EXECUTABLE_PROJECT} INCLUDE_BY_TYPE platforms Qt::QXcbIntegrationPlugin)
|
qt_import_plugins(${EXECUTABLE_PROJECT} INCLUDE_BY_TYPE
|
||||||
|
platforms Qt::QXcbIntegrationPlugin
|
||||||
|
Qt::QMinimalIntegrationPlugin
|
||||||
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_include_directories(${EXECUTABLE_PROJECT} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/autogen/)
|
target_include_directories(${EXECUTABLE_PROJECT} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/autogen/)
|
||||||
|
|
|
@ -73,4 +73,11 @@ set_target_properties(${PROJECT_NAME}
|
||||||
AUTORCC ON
|
AUTORCC ON
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (CHATTERINO_STATIC_QT_BUILD)
|
||||||
|
qt_import_plugins(${PROJECT_NAME} INCLUDE_BY_TYPE
|
||||||
|
platforms Qt::QXcbIntegrationPlugin
|
||||||
|
Qt::QMinimalIntegrationPlugin
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
gtest_discover_tests(${PROJECT_NAME})
|
gtest_discover_tests(${PROJECT_NAME})
|
||||||
|
|
Loading…
Reference in a new issue