2020-12-26 23:40:47 +01:00
|
|
|
---
|
2024-02-11 19:11:30 +01:00
|
|
|
name: Test Ubuntu
|
2020-12-26 23:40:47 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2022-06-14 14:48:21 +02:00
|
|
|
workflow_dispatch:
|
2023-07-29 13:02:43 +02:00
|
|
|
merge_group:
|
2024-07-21 11:40:29 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- main
|
2020-12-26 23:40:47 +01:00
|
|
|
|
2022-05-07 17:22:39 +02:00
|
|
|
env:
|
2024-02-11 19:11:30 +01:00
|
|
|
TWITCH_PUBSUB_SERVER_TAG: v1.0.7
|
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:
|
2024-02-11 19:11:30 +01:00
|
|
|
name: "${{ matrix.os }}"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: ${{ matrix.container }}
|
2020-12-26 23:40:47 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-06-24 23:48:29 +02:00
|
|
|
include:
|
2023-08-27 13:11:59 +02:00
|
|
|
- os: "ubuntu-22.04"
|
2024-02-11 19:11:30 +01:00
|
|
|
container: ghcr.io/chatterino/chatterino2-build-ubuntu-22.04:latest
|
2024-08-30 13:48:56 +02:00
|
|
|
qt-version: 6.7.1
|
2024-02-11 19:11:30 +01:00
|
|
|
plugins: true
|
2020-12-26 23:40:47 +01:00
|
|
|
fail-fast: false
|
2023-07-29 13:02:43 +02:00
|
|
|
env:
|
2024-02-11 19:11:30 +01:00
|
|
|
C2_PLUGINS: ${{ matrix.plugins }}
|
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
|
|
|
|
|
|
|
|
- name: Create build directory (Ubuntu)
|
2024-02-11 19:11:30 +01:00
|
|
|
run: mkdir build-test
|
|
|
|
|
2024-07-21 11:40:29 +02:00
|
|
|
- name: Install dependencies
|
2020-12-26 23:40:47 +01:00
|
|
|
run: |
|
2024-02-11 19:11:30 +01:00
|
|
|
sudo apt update
|
2024-07-21 11:40:29 +02:00
|
|
|
sudo DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install \
|
|
|
|
libbenchmark-dev gcovr gnupg
|
2020-12-26 23:40:47 +01:00
|
|
|
|
|
|
|
- name: Build (Ubuntu)
|
|
|
|
run: |
|
2023-06-24 23:48:29 +02:00
|
|
|
cmake \
|
|
|
|
-DBUILD_TESTS=On \
|
2023-11-26 17:54:33 +01:00
|
|
|
-DBUILD_BENCHMARKS=On \
|
2023-06-24 23:48:29 +02:00
|
|
|
-DBUILD_APP=OFF \
|
2024-02-11 19:11:30 +01:00
|
|
|
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
|
|
|
|
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
|
|
|
|
-DCHATTERINO_STATIC_QT_BUILD=On \
|
2024-07-21 11:40:29 +02:00
|
|
|
-DCHATTERINO_GENERATE_COVERAGE=On \
|
|
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
2023-06-24 23:48:29 +02:00
|
|
|
..
|
2024-09-15 14:29:52 +02:00
|
|
|
cmake --build . -j $(nproc)
|
2020-12-26 23:40:47 +01:00
|
|
|
working-directory: build-test
|
|
|
|
|
2024-02-11 19:11:30 +01:00
|
|
|
- name: Download and extract Twitch PubSub Server Test
|
|
|
|
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
|
2023-07-29 11:49:44 +02:00
|
|
|
timeout-minutes: 30
|
2020-12-26 23:40:47 +01:00
|
|
|
run: |
|
2024-02-11 19:11:30 +01:00
|
|
|
httpbox --port 9051 &
|
|
|
|
cd ../pubsub-server-test
|
|
|
|
./server 127.0.0.1:9050 &
|
|
|
|
cd ../build-test
|
2024-09-29 12:20:06 +02:00
|
|
|
ctest --repeat until-pass:4 --output-on-failure
|
2020-12-26 23:40:47 +01:00
|
|
|
working-directory: build-test
|
2024-07-21 11:40:29 +02:00
|
|
|
|
2024-09-29 14:38:05 +02:00
|
|
|
- name: Run benchmark
|
|
|
|
timeout-minutes: 2
|
|
|
|
run: |
|
|
|
|
./bin/chatterino-benchmark --benchmark_min_time=1x
|
|
|
|
working-directory: build-test
|
|
|
|
|
2024-07-21 11:40:29 +02:00
|
|
|
- name: Upload coverage reports to Codecov
|
2024-11-21 11:08:33 +01:00
|
|
|
uses: codecov/codecov-action@v5.0.7
|
2024-07-21 11:40:29 +02:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2024-11-17 11:57:54 +01:00
|
|
|
plugins: gcov
|
2024-07-21 11:40:29 +02:00
|
|
|
fail_ci_if_error: true
|
|
|
|
verbose: true
|