2020-12-26 23:40:47 +01:00
|
|
|
---
|
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2022-06-14 14:48:21 +02:00
|
|
|
workflow_dispatch:
|
2020-12-26 23:40:47 +01:00
|
|
|
|
2022-05-07 17:22:39 +02:00
|
|
|
env:
|
|
|
|
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.3
|
|
|
|
|
2022-05-21 11:33:21 +02:00
|
|
|
concurrency:
|
|
|
|
group: test-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-12-26 23:40:47 +01:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04]
|
2022-06-14 14:48:21 +02:00
|
|
|
qt-version: [5.15.2]
|
2020-12-26 23:40:47 +01:00
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
steps:
|
2022-03-04 14:49:51 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-26 23:40:47 +01:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Cache Qt
|
|
|
|
id: cache-qt
|
2022-03-22 12:50:52 +01:00
|
|
|
uses: actions/cache@v3
|
2020-12-26 23:40:47 +01:00
|
|
|
with:
|
2022-06-14 14:48:21 +02:00
|
|
|
path: "${{ github.workspace }}/qt/"
|
|
|
|
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
|
2020-12-26 23:40:47 +01:00
|
|
|
|
|
|
|
# LINUX
|
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v2
|
|
|
|
with:
|
|
|
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
2022-06-14 14:48:21 +02:00
|
|
|
version: ${{ matrix.qt-version }}
|
|
|
|
dir: "${{ github.workspace }}/qt/"
|
2020-12-26 23:40:47 +01:00
|
|
|
|
|
|
|
# LINUX
|
|
|
|
- name: Install dependencies (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
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 \
|
2022-05-22 15:43:41 +02:00
|
|
|
libxcb-xinerama0
|
2020-12-26 23:40:47 +01:00
|
|
|
|
|
|
|
- name: Create build directory (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
mkdir build-test
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Build (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2021-03-28 16:58:51 +02:00
|
|
|
cmake -DBUILD_TESTS=On -DBUILD_APP=OFF ..
|
2021-02-13 19:17:22 +01:00
|
|
|
cmake --build . --config Release
|
2020-12-26 23:40:47 +01:00
|
|
|
working-directory: build-test
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Test (Ubuntu)
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2022-05-30 01:43:13 +02:00
|
|
|
docker pull kennethreitz/httpbin
|
2022-05-07 17:22:39 +02:00
|
|
|
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
|
|
|
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
|
2022-05-30 01:43:13 +02:00
|
|
|
docker run -p 9051:80 --detach kennethreitz/httpbin
|
2021-03-28 16:58:51 +02:00
|
|
|
./bin/chatterino-test --platform minimal
|
2020-12-26 23:40:47 +01:00
|
|
|
working-directory: build-test
|
|
|
|
shell: bash
|