-
-
Notifications
You must be signed in to change notification settings - Fork 470
135 lines (117 loc) · 4.07 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
name: Test Ubuntu
on:
pull_request:
workflow_dispatch:
merge_group:
push:
branches:
- master
- main
env:
TWITCH_PUBSUB_SERVER_TAG: v1.0.8
HTTPBOX_TAG: v0.2.1
QT_QPA_PLATFORM: minimal
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: "Test ${{ matrix.os }}, Qt ${{ matrix.qt-version }}"
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
include:
- os: "ubuntu-22.04"
container: ghcr.io/chatterino/chatterino2-build-ubuntu-22.04:latest
qt-version: 6.7.1
plugins: true
fail-fast: false
env:
C2_PLUGINS: ${{ matrix.plugins }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Create build directory (Ubuntu)
run: mkdir build-test
- name: Install dependencies
run: |
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install \
libbenchmark-dev gcovr gnupg
- name: Install httpbox
run: |
curl -L -o httpbox.tar.xz "https://github.com/Chatterino/httpbox/releases/download/${{ env.HTTPBOX_TAG }}/httpbox-x86_64-unknown-linux-gnu.tar.xz"
tar -xJf httpbox.tar.xz
mv ./httpbox-x86_64-unknown-linux-gnu/httpbox /usr/local/bin
working-directory: /tmp
- name: Build (Ubuntu)
run: |
cmake \
-DBUILD_TESTS=On \
-DBUILD_BENCHMARKS=On \
-DBUILD_APP=OFF \
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
-DCMAKE_PREFIX_PATH="$Qt6_DIR/lib/cmake" \
-DCHATTERINO_STATIC_QT_BUILD=On \
-DCHATTERINO_GENERATE_COVERAGE=On \
-DCMAKE_BUILD_TYPE=Debug \
..
cmake --build . -j $(nproc)
working-directory: build-test
- 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
cd ..
- name: Test
timeout-minutes: 30
run: |
httpbox --port 9051 &
cd ../pubsub-server-test
./server 127.0.0.1:9050 &
cd ../build-test
ctest --repeat until-pass:4 --output-on-failure
working-directory: build-test
- name: Run benchmark
timeout-minutes: 2
run: |
./bin/chatterino-benchmark --benchmark_min_time=1x
working-directory: build-test
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
plugins: gcov
fail_ci_if_error: true
verbose: true
eventsub-test:
name: "EventSub python test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install \
python3 python3-venv clang-18 clang-format-18 libclang-18-dev
echo "LIBCLANG_LIBRARY_FILE=/usr/lib/x86_64-linux-gnu/libclang-18.so" >> "$GITHUB_ENV"
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 42
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 42
- name: Setup virtual environment
run: |
python3 -m venv venv
./venv/bin/pip3 install -r requirements.txt
./venv/bin/pip3 install -r requirements-dev.txt
working-directory: lib/twitch-eventsub-ws/ast
- name: Run pytest
run: |
./venv/bin/pytest
working-directory: lib/twitch-eventsub-ws/ast