From 8cacd5e7b9ace687de0f8b8ce990bd30fb58c82b Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:49:01 +0200 Subject: [PATCH 01/91] Create test-windows.yml --- .github/workflows/test-windows.yml | 143 +++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 .github/workflows/test-windows.yml diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml new file mode 100644 index 00000000000..7d269fa2617 --- /dev/null +++ b/.github/workflows/test-windows.yml @@ -0,0 +1,143 @@ +--- +name: Test Windows + +on: + pull_request: + workflow_dispatch: + merge_group: + +env: + TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.6 + QT_QPA_PLATFORM: minimal + # Last known good conan version + # 2.0.3 has a bug on Windows (conan-io/conan#13606) + CONAN_VERSION: 2.0.2 + +concurrency: + group: test-${{ github.ref }} + cancel-in-progress: true + +jobs: + test-windows: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: "windows-latest" + qt-version: "5.15.2" + - os: "windows-latest" + qt-version: "5.12.12" + - os: "windows-latest" + qt-version: "6.2.4" + fail-fast: false + env: + C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} + QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }} + + steps: + - name: Set environment variables for windows-latest + if: matrix.os == 'windows-latest' + run: | + echo "vs_version=2022" >> "$GITHUB_ENV" + shell: bash + + - name: Set BUILD_WITH_QT6 + if: startsWith(matrix.qt-version, '6.') + run: | + echo "C2_BUILD_WITH_QT6=ON" >> "$GITHUB_ENV" + shell: bash + + - uses: actions/checkout@v4 + with: + 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: Enable Developer Command Prompt + if: startsWith(matrix.os, 'windows') + uses: ilammy/msvc-dev-cmd@v1.12.1 + + - name: Setup conan variables + if: startsWith(matrix.os, 'windows') + run: | + "C2_USE_OPENSSL3=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "True" } else { "False" })" >> "$Env:GITHUB_ENV" + "C2_CONAN_CACHE_SUFFIX=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "-QT6" } else { "`" })" >> "$Env:GITHUB_ENV" + shell: powershell + + - name: Setup sccache + # sccache v0.5.3 + uses: nerixyz/ccache-action@9a7e8d00116ede600ee7717350c6594b8af6aaa5 + if: startsWith(matrix.os, 'windows') + with: + variant: sccache + # only save on the default (master) branch + save: ${{ github.event_name == 'push' }} + key: sccache-test-${{ matrix.os }}-${{ matrix.qt-version }} + restore_keys: | + sccache-test-${{ matrix.os }}-${{ matrix.qt-version }} + + - name: Cache conan packages + if: startsWith(matrix.os, 'windows') + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.py') }}${{ env.C2_CONAN_CACHE_SUFFIX }} + path: ~/.conan2/ + + - name: Install Conan + if: startsWith(matrix.os, 'windows') + run: | + python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$GITHUB_PATH" + pip3 install --user "conan==${{ env.CONAN_VERSION }}" + + - name: Setup Conan + if: startsWith(matrix.os, 'windows') + run: | + conan --version + conan profile detect -f + + - name: Create build directory + if: startsWith(matrix.os, 'ubuntu') + run: | + mkdir build-test + cd build-test + shell: bash + + - name: Install dependencies + if: startsWith(matrix.os, 'windows') + run: | + conan install .. ` + -s build_type=RelWithDebInfo ` + -c tools.cmake.cmaketoolchain:generator="NMake Makefiles" ` + -b missing ` + --output-folder=. ` + -o with_openssl3="$Env:C2_USE_OPENSSL3" + + - name: Build + if: startsWith(matrix.os, 'windows') + shell: pwsh + env: + # Enable PCH on Windows + C2_WINDOWS_USE_PCH: True + run: | + cmake -G"NMake Makefiles" -DBUILD_TESTS=On -DBUILD_APP=OFF -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" .. + set cl=/MP + nmake /S /NOLOGO + working-directory: build-test + + - name: Test + if: startsWith(matrix.os, 'windows') + timeout-minutes: 30 + run: | + 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 + ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe + working-directory: build-test + shell: pwsh From f950da55c2654b5288b36bb130152d869d395626 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:02:55 +0200 Subject: [PATCH 02/91] Fix restore-keys and made Create build directory run on windows --- .github/workflows/test-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 7d269fa2617..055bb0751dd 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -79,7 +79,7 @@ jobs: # only save on the default (master) branch save: ${{ github.event_name == 'push' }} key: sccache-test-${{ matrix.os }}-${{ matrix.qt-version }} - restore_keys: | + restore-keys: | sccache-test-${{ matrix.os }}-${{ matrix.qt-version }} - name: Cache conan packages @@ -102,7 +102,7 @@ jobs: conan profile detect -f - name: Create build directory - if: startsWith(matrix.os, 'ubuntu') + if: startsWith(matrix.os, 'windows') run: | mkdir build-test cd build-test From 168eb3f4ef706c76fd517c903dbd8149eb54e21a Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:16:44 +0200 Subject: [PATCH 03/91] Move cd from create to install --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 055bb0751dd..3dedf7ba649 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -105,12 +105,12 @@ jobs: if: startsWith(matrix.os, 'windows') run: | mkdir build-test - cd build-test shell: bash - name: Install dependencies if: startsWith(matrix.os, 'windows') run: | + cd build-test conan install .. ` -s build_type=RelWithDebInfo ` -c tools.cmake.cmaketoolchain:generator="NMake Makefiles" ` From fddc92ff4679bdcc43f324828c8bf7477046a4e3 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:17:09 +0200 Subject: [PATCH 04/91] Move mkdir to install --- .github/workflows/test-windows.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 3dedf7ba649..178f546328a 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -101,15 +101,10 @@ jobs: conan --version conan profile detect -f - - name: Create build directory - if: startsWith(matrix.os, 'windows') - run: | - mkdir build-test - shell: bash - - name: Install dependencies if: startsWith(matrix.os, 'windows') run: | + mkdir build-test cd build-test conan install .. ` -s build_type=RelWithDebInfo ` From 4c101c78fe6c66f7c7ca0319c1f246fb78ce6810 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:01:06 +0200 Subject: [PATCH 05/91] Output directory contents before running nmake --- .github/workflows/test-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 178f546328a..35f56a68e9f 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -122,6 +122,7 @@ jobs: run: | cmake -G"NMake Makefiles" -DBUILD_TESTS=On -DBUILD_APP=OFF -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" .. set cl=/MP + dir nmake /S /NOLOGO working-directory: build-test From 301870b0faf1aae3f623e939935b13423c2b2304 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:41:21 +0200 Subject: [PATCH 06/91] Change bash syntax to pwsh syntax in 2 places --- .github/workflows/test-windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 35f56a68e9f..796af64f41b 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -38,14 +38,14 @@ jobs: - name: Set environment variables for windows-latest if: matrix.os == 'windows-latest' run: | - echo "vs_version=2022" >> "$GITHUB_ENV" - shell: bash + echo "vs_version=2022" >> "$Env:GITHUB_ENV" + shell: pwsh - name: Set BUILD_WITH_QT6 if: startsWith(matrix.qt-version, '6.') run: | - echo "C2_BUILD_WITH_QT6=ON" >> "$GITHUB_ENV" - shell: bash + echo "C2_BUILD_WITH_QT6=ON" >> "$Env:GITHUB_ENV" + shell: pwsh - uses: actions/checkout@v4 with: From bf9185dde8b9775fe77a611fce9dc47a3f1772ed Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:42:09 +0200 Subject: [PATCH 07/91] Change bash syntax to pwsh syntax in 1 other place --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 796af64f41b..7c1faccb989 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -92,7 +92,7 @@ jobs: - name: Install Conan if: startsWith(matrix.os, 'windows') run: | - python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$GITHUB_PATH" + python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$Env:GITHUB_PATH" pip3 install --user "conan==${{ env.CONAN_VERSION }}" - name: Setup Conan From eaff46d1049f6f6d760044ec4310b0668f51d238 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:46:45 +0200 Subject: [PATCH 08/91] Change group name to hopefully prevent automatic cancellations --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 7c1faccb989..061de593a08 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -14,7 +14,7 @@ env: CONAN_VERSION: 2.0.2 concurrency: - group: test-${{ github.ref }} + group: test-windows-${{ github.ref }} cancel-in-progress: true jobs: From 25f0646ba7b8a54c51cf4c74c8b9ffd7b66fbb99 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:13:47 +0200 Subject: [PATCH 09/91] Ensure PowerShell is being used for installing Conan --- .github/workflows/test-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 061de593a08..716cde31df0 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -94,6 +94,7 @@ jobs: run: | python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$Env:GITHUB_PATH" pip3 install --user "conan==${{ env.CONAN_VERSION }}" + shell: pwsh - name: Setup Conan if: startsWith(matrix.os, 'windows') @@ -112,6 +113,7 @@ jobs: -b missing ` --output-folder=. ` -o with_openssl3="$Env:C2_USE_OPENSSL3" + shell: pwsh - name: Build if: startsWith(matrix.os, 'windows') From a153c9e3c6bfdd931b6ec2dab3afbee1406402e2 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:36:46 +0200 Subject: [PATCH 10/91] Add conan toolchain and precompiled headers cmake switch --- .github/workflows/test-windows.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 716cde31df0..a532f98e4fa 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -113,7 +113,7 @@ jobs: -b missing ` --output-folder=. ` -o with_openssl3="$Env:C2_USE_OPENSSL3" - shell: pwsh + shell: powershell - name: Build if: startsWith(matrix.os, 'windows') @@ -122,7 +122,14 @@ jobs: # Enable PCH on Windows C2_WINDOWS_USE_PCH: True run: | - cmake -G"NMake Makefiles" -DBUILD_TESTS=On -DBUILD_APP=OFF -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" .. + cmake ` + -G"NMake Makefiles" ` + -DBUILD_TESTS=On ` + -DBUILD_APP=OFF ` + -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" ` + -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" ` + -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} ` + .. set cl=/MP dir nmake /S /NOLOGO From 66821c11d6f5d14e7f5c96efaeea0f26114509b3 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:45:03 +0200 Subject: [PATCH 11/91] Add `Env:` to -DBUILD_WITH_QT6 --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index a532f98e4fa..19841f6966e 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -126,7 +126,7 @@ jobs: -G"NMake Makefiles" ` -DBUILD_TESTS=On ` -DBUILD_APP=OFF ` - -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" ` + -DBUILD_WITH_QT6="$Env:C2_BUILD_WITH_QT6" ` -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" ` -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} ` .. From b14ad9b6a99054b9f9a661c46691136450ed4955 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:06:06 +0200 Subject: [PATCH 12/91] Remove `dir` before `nmake` --- .github/workflows/test-windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 19841f6966e..f2b282c9e72 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -131,7 +131,6 @@ jobs: -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} ` .. set cl=/MP - dir nmake /S /NOLOGO working-directory: build-test From acd5100c019181db3ac313bb6e00090f2d6dae50 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:25:41 +0200 Subject: [PATCH 13/91] Disable PCH for now --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index f2b282c9e72..d013482e3ac 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -120,7 +120,7 @@ jobs: shell: pwsh env: # Enable PCH on Windows - C2_WINDOWS_USE_PCH: True + C2_WINDOWS_USE_PCH: False run: | cmake ` -G"NMake Makefiles" ` From cf99ec6b536da3910754d1950b6e638197f4e9e7 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:08:46 +0200 Subject: [PATCH 14/91] diff-checked a little bit with the build workflow --- .github/workflows/test-windows.yml | 39 ++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index d013482e3ac..67ca4b0c1ce 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -19,6 +19,7 @@ concurrency: jobs: test-windows: + name: "Test ${{ matrix.os }}, Qt ${{ matrix.qt-version }}" runs-on: ${{ matrix.os }} strategy: matrix: @@ -34,7 +35,25 @@ jobs: C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }} - steps: + steps: + - name: Force LTO + if: matrix.force-lto + run: | + echo "C2_ENABLE_LTO=ON" >> "$Env:GITHUB_ENV" + shell: pwsh + + - name: Enable plugin support + if: matrix.plugins + run: | + echo "C2_PLUGINS=ON" >> "$Env:GITHUB_ENV" + shell: pwsh + + - name: Set Crashpad + if: matrix.skip-crashpad == false + run: | + echo "C2_ENABLE_CRASHPAD=ON" >> "$Env:GITHUB_ENV" + shell: pwsh + - name: Set environment variables for windows-latest if: matrix.os == 'windows-latest' run: | @@ -50,6 +69,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 # allows for tags access - name: Install Qt uses: jurplel/install-qt-action@v3.3.0 @@ -78,7 +98,7 @@ jobs: variant: sccache # only save on the default (master) branch save: ${{ github.event_name == 'push' }} - key: sccache-test-${{ matrix.os }}-${{ matrix.qt-version }} + key: sccache-test-${{ matrix.os }}-${{ matrix.qt-version }}-${{ matrix.skip-crashpad }} restore-keys: | sccache-test-${{ matrix.os }}-${{ matrix.qt-version }} @@ -119,16 +139,20 @@ jobs: if: startsWith(matrix.os, 'windows') shell: pwsh env: - # Enable PCH on Windows - C2_WINDOWS_USE_PCH: False + # Enable PCH on Windows, later we can have it depend on the run/Qt Version like in the build workflow, I just want to make it work + C2_WINDOWS_USE_PCH: True run: | cmake ` -G"NMake Makefiles" ` + -DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DBUILD_TESTS=On ` -DBUILD_APP=OFF ` - -DBUILD_WITH_QT6="$Env:C2_BUILD_WITH_QT6" ` -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" ` -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} ` + -DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" ` + -DCHATTERINO_LTO="$Env:C2_ENABLE_LTO" ` + -DCHATTERINO_PLUGINS="$Env:C2_PLUGINS" ` + -DBUILD_WITH_QT6="$Env:C2_BUILD_WITH_QT6" ` .. set cl=/MP nmake /S /NOLOGO @@ -145,3 +169,8 @@ jobs: ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe working-directory: build-test shell: pwsh + + - name: Clean Conan cache + if: startsWith(matrix.os, 'windows') + run: conan cache clean --source --build --download "*" + shell: pwsh From 5473cc33f65581821ef820734c9ebd5cac6811fc Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:11:14 +0200 Subject: [PATCH 15/91] Remove includes and just use the matrix --- .github/workflows/test-windows.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 67ca4b0c1ce..22afdbdaf9c 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -23,13 +23,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - include: - - os: "windows-latest" - qt-version: "5.15.2" - - os: "windows-latest" - qt-version: "5.12.12" - - os: "windows-latest" - qt-version: "6.2.4" + os: [windows-latest] + qt-version: [5.15.2, 6.5.0] + force-lto: [false] + plugins: [false] + skip-artifact: [false] + skip-crashpad: [false] + clang-tidy-review: [false] fail-fast: false env: C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} From 3838b77ec4e774580956468176d8d9168de1ca3f Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:19:22 +0200 Subject: [PATCH 16/91] Change 6.5.0 to 6.2.4 --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 22afdbdaf9c..adc5a3199ec 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: os: [windows-latest] - qt-version: [5.15.2, 6.5.0] + qt-version: [5.15.2, 6.2.4] force-lto: [false] plugins: [false] skip-artifact: [false] From d43bed2002f87f120df53cd64447949d7cb29236 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:23:16 +0200 Subject: [PATCH 17/91] Remove accidental tabs --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index adc5a3199ec..215bf340427 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -41,7 +41,7 @@ jobs: run: | echo "C2_ENABLE_LTO=ON" >> "$Env:GITHUB_ENV" shell: pwsh - + - name: Enable plugin support if: matrix.plugins run: | From e479c2eb03ce91ea856860716ff6b8a6c9a45c8a Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:23:28 +0200 Subject: [PATCH 18/91] Initial MacOS Implementation --- .github/workflows/test-macos.yml | 99 ++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/test-macos.yml diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml new file mode 100644 index 00000000000..7e445d6d535 --- /dev/null +++ b/.github/workflows/test-macos.yml @@ -0,0 +1,99 @@ +--- +name: Test MacOS + +on: + pull_request: + workflow_dispatch: + merge_group: + +env: + TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.6 + QT_QPA_PLATFORM: minimal + +concurrency: + group: test-macos-${{ github.ref }} + cancel-in-progress: true + +jobs: + test-macos: + name: "Test ${{ matrix.os }}, Qt ${{ matrix.qt-version }}" + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + qt-version: [5.15.2, 6.2.4] + force-lto: [false] + plugins: [false] + clang-tidy-review: [false] + fail-fast: false + env: + C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} + QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }} + + steps: + - name: Force LTO + if: matrix.force-lto + run: | + echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV" + shell: bash + + - name: Enable plugin support + if: matrix.plugins + run: | + echo "C2_PLUGINS=ON" >> "$GITHUB_ENV" + shell: bash + + - name: Set BUILD_WITH_QT6 + if: startsWith(matrix.qt-version, '6.') + run: | + echo "C2_BUILD_WITH_QT6=ON" >> "$GITHUB_ENV" + shell: bash + + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 # allows for tags access + + - 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: Install dependencies + if: startsWith(matrix.os, 'macos') + run: | + brew install boost openssl rapidjson p7zip create-dmg cmake tree + shell: bash + + - name: Build + if: startsWith(matrix.os, 'macos') + shell: bash + run: | + mkdir build-test + cd build-test + cmake \ + -G"NMake Makefiles" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_TESTS=On \ + -DBUILD_APP=OFF \ + -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} \ + -DCHATTERINO_LTO="$C2_ENABLE_LTO" \ + -DCHATTERINO_PLUGINS="$C2_PLUGINS" \ + -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \ + .. + make -j"$(sysctl -n hw.logicalcpu) + + - name: Test + if: startsWith(matrix.os, 'macos') + timeout-minutes: 30 + run: | + 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 + ./bin/chatterino-test || ./bin/chatterino-test || ./bin/chatterino-test + working-directory: build-test + shell: bash From b8089b6200c8139d44940aaadf91f971efcef913 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:27:31 +0200 Subject: [PATCH 19/91] Remove `NMake Makefiles` from macos test workflow --- .github/workflows/test-macos.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 7e445d6d535..5a39ef569d8 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -75,7 +75,6 @@ jobs: mkdir build-test cd build-test cmake \ - -G"NMake Makefiles" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_TESTS=On \ -DBUILD_APP=OFF \ From 8da3932fa8c3049a3fa0f103c42886de97938be8 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:32:06 +0200 Subject: [PATCH 20/91] Disable PCH for MacOS --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 5a39ef569d8..d9a1bf8cc57 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -78,7 +78,7 @@ jobs: -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_TESTS=On \ -DBUILD_APP=OFF \ - -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} \ + -DUSE_PRECOMPILED_HEADERS=OFF \ -DCHATTERINO_LTO="$C2_ENABLE_LTO" \ -DCHATTERINO_PLUGINS="$C2_PLUGINS" \ -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \ From 0376b1ac2e02836f293969bb7d4f102671d461fa Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:36:47 +0200 Subject: [PATCH 21/91] Add missing double quote in make command --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index d9a1bf8cc57..e1d3f20d2a2 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -83,7 +83,7 @@ jobs: -DCHATTERINO_PLUGINS="$C2_PLUGINS" \ -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \ .. - make -j"$(sysctl -n hw.logicalcpu) + make -j"$(sysctl -n hw.logicalcpu)" - name: Test if: startsWith(matrix.os, 'macos') From b74df1c94fc699cad1d137046af643f086f2ac3a Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:28:21 +0200 Subject: [PATCH 22/91] Test ChatGPT's suggestion on fixing the C++ error in `InputCompletion.cpp` test file --- tests/src/InputCompletion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/InputCompletion.cpp b/tests/src/InputCompletion.cpp index aadfc46377c..1977977ec9b 100644 --- a/tests/src/InputCompletion.cpp +++ b/tests/src/InputCompletion.cpp @@ -261,7 +261,7 @@ TEST_F(InputCompletionTest, ClassicEmoteNameFiltering) completion = queryClassicEmoteCompletion(":)"); ASSERT_EQ(completion.size(), 3); ASSERT_EQ(completion[0].displayName, ":)"); // Exact match with : prefix - containsRoughly({completion.begin() + 1, 2}, {":-)", "B-)"}); + containsRoughly(std::span(completion.begin() + 1, 2), {":-)", "B-)"}); completion = queryClassicEmoteCompletion(":cat"); ASSERT_TRUE(completion.size() >= 2); From 6912c861e6b39f4fac99006dca493984ced3536d Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:54:12 +0200 Subject: [PATCH 23/91] ChatGPT Fix --- tests/src/InputCompletion.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/src/InputCompletion.cpp b/tests/src/InputCompletion.cpp index 1977977ec9b..3cf3bf1bc7d 100644 --- a/tests/src/InputCompletion.cpp +++ b/tests/src/InputCompletion.cpp @@ -261,7 +261,8 @@ TEST_F(InputCompletionTest, ClassicEmoteNameFiltering) completion = queryClassicEmoteCompletion(":)"); ASSERT_EQ(completion.size(), 3); ASSERT_EQ(completion[0].displayName, ":)"); // Exact match with : prefix - containsRoughly(std::span(completion.begin() + 1, 2), {":-)", "B-)"}); + std::vector tempVector(completion.begin() + 1, completion.begin() + 3); + containsRoughly(std::span(tempVector), {":-)", "B-)"}); completion = queryClassicEmoteCompletion(":cat"); ASSERT_TRUE(completion.size() >= 2); From 2dc5414143e5e8f979651c4b50bff0b92df1eed5 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:24:03 +0200 Subject: [PATCH 24/91] Use docker-machine to hopefully bypass the `docker: command not found` error. --- .github/workflows/test-macos.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index e1d3f20d2a2..50bb5309858 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -65,7 +65,14 @@ jobs: - name: Install dependencies if: startsWith(matrix.os, 'macos') run: | - brew install boost openssl rapidjson p7zip create-dmg cmake tree + brew install boost openssl rapidjson p7zip create-dmg cmake tree docker docker-machine + brew cask install virtualbox + shell: bash + + - name: Setup Docker + if: startsWith(matrix.os, 'macos') + run: | + docker-machine create --driver virtualbox default shell: bash - name: Build @@ -89,10 +96,13 @@ jobs: if: startsWith(matrix.os, 'macos') timeout-minutes: 30 run: | + docker-machine env default + eval $(docker-machine env default) 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 ./bin/chatterino-test || ./bin/chatterino-test || ./bin/chatterino-test + docker-machine stop default working-directory: build-test shell: bash From fcbc47d2dd94637552c9bcb49704da91fbd80ae4 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:29:04 +0200 Subject: [PATCH 25/91] Don't use a removed brew command! --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 50bb5309858..85b9e5a02a3 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -66,7 +66,7 @@ jobs: if: startsWith(matrix.os, 'macos') run: | brew install boost openssl rapidjson p7zip create-dmg cmake tree docker docker-machine - brew cask install virtualbox + brew install virtualbox --cask shell: bash - name: Setup Docker From e18560afbfb53b2430d16a600353414a98d204a4 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:56:15 +0200 Subject: [PATCH 26/91] Replace docker-machine and virtualbox with colima --- .github/workflows/test-macos.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 85b9e5a02a3..4a00596e34f 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -65,14 +65,13 @@ jobs: - name: Install dependencies if: startsWith(matrix.os, 'macos') run: | - brew install boost openssl rapidjson p7zip create-dmg cmake tree docker docker-machine - brew install virtualbox --cask + brew install boost openssl rapidjson p7zip create-dmg cmake tree docker colima shell: bash - - name: Setup Docker + - name: Setup Colima if: startsWith(matrix.os, 'macos') run: | - docker-machine create --driver virtualbox default + colima start shell: bash - name: Build @@ -96,13 +95,11 @@ jobs: if: startsWith(matrix.os, 'macos') timeout-minutes: 30 run: | - docker-machine env default - eval $(docker-machine env default) 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 ./bin/chatterino-test || ./bin/chatterino-test || ./bin/chatterino-test - docker-machine stop default + colima stop working-directory: build-test shell: bash From 57ec3115285372fe6163bfc0fe14e799904baa3d Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:20:32 +0200 Subject: [PATCH 27/91] Make sure Colima is getting stopped --- .github/workflows/test-macos.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 4a00596e34f..65d0fb389aa 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -100,6 +100,13 @@ jobs: docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }} docker run -p 9051:80 --detach kennethreitz/httpbin ./bin/chatterino-test || ./bin/chatterino-test || ./bin/chatterino-test + working-directory: build-test + shell: bash + + - name: Post Setup Colima + if: startsWith(matrix.os, 'macos') + timeout-minutes: 30 + run: | colima stop working-directory: build-test shell: bash From 44ac461d92343591a842bb346a61d10915f46646 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:32:04 +0200 Subject: [PATCH 28/91] Try to run docker without colima. If that doesn't work, I'll revert. --- .github/workflows/test-macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 65d0fb389aa..1543a9805c9 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -71,7 +71,7 @@ jobs: - name: Setup Colima if: startsWith(matrix.os, 'macos') run: | - colima start + echo colima start shell: bash - name: Build @@ -107,6 +107,6 @@ jobs: if: startsWith(matrix.os, 'macos') timeout-minutes: 30 run: | - colima stop + echo colima stop working-directory: build-test shell: bash From 9867aa0d132364136d22724fac335cd5fea39813 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:54:47 +0200 Subject: [PATCH 29/91] Revert Test for without Colima --- .github/workflows/test-macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 1543a9805c9..65d0fb389aa 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -71,7 +71,7 @@ jobs: - name: Setup Colima if: startsWith(matrix.os, 'macos') run: | - echo colima start + colima start shell: bash - name: Build @@ -107,6 +107,6 @@ jobs: if: startsWith(matrix.os, 'macos') timeout-minutes: 30 run: | - echo colima stop + colima stop working-directory: build-test shell: bash From 94a8ad068d5519b14031f49ad1955d85914c2b41 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:56:25 +0200 Subject: [PATCH 30/91] Make Post Setup Colima run even if earlier Jobs failed --- .github/workflows/test-macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 65d0fb389aa..0acece0c684 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -104,8 +104,7 @@ jobs: shell: bash - name: Post Setup Colima - if: startsWith(matrix.os, 'macos') - timeout-minutes: 30 + if: startsWith(matrix.os, 'macos') && always() run: | colima stop working-directory: build-test From f18af1178b0d8bcb3e423cc41bda3e09ae8916fb Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:25:30 +0200 Subject: [PATCH 31/91] Replace `completion.begin() + 3` with `2` --- tests/src/InputCompletion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/InputCompletion.cpp b/tests/src/InputCompletion.cpp index 3cf3bf1bc7d..06848536856 100644 --- a/tests/src/InputCompletion.cpp +++ b/tests/src/InputCompletion.cpp @@ -261,7 +261,7 @@ TEST_F(InputCompletionTest, ClassicEmoteNameFiltering) completion = queryClassicEmoteCompletion(":)"); ASSERT_EQ(completion.size(), 3); ASSERT_EQ(completion[0].displayName, ":)"); // Exact match with : prefix - std::vector tempVector(completion.begin() + 1, completion.begin() + 3); + std::vector tempVector(completion.begin() + 1, 2); containsRoughly(std::span(tempVector), {":-)", "B-)"}); completion = queryClassicEmoteCompletion(":cat"); From 95d8ec64fabf3f5a457068a17c73cc1d0348d415 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:26:17 +0200 Subject: [PATCH 32/91] Revert cpp changes --- tests/src/InputCompletion.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/src/InputCompletion.cpp b/tests/src/InputCompletion.cpp index 06848536856..aadfc46377c 100644 --- a/tests/src/InputCompletion.cpp +++ b/tests/src/InputCompletion.cpp @@ -261,8 +261,7 @@ TEST_F(InputCompletionTest, ClassicEmoteNameFiltering) completion = queryClassicEmoteCompletion(":)"); ASSERT_EQ(completion.size(), 3); ASSERT_EQ(completion[0].displayName, ":)"); // Exact match with : prefix - std::vector tempVector(completion.begin() + 1, 2); - containsRoughly(std::span(tempVector), {":-)", "B-)"}); + containsRoughly({completion.begin() + 1, 2}, {":-)", "B-)"}); completion = queryClassicEmoteCompletion(":cat"); ASSERT_TRUE(completion.size() >= 2); From e5ca379034b176b2b668ca8fbbe66c920d157dbb Mon Sep 17 00:00:00 2001 From: Wissididom Date: Tue, 26 Sep 2023 17:45:27 +0200 Subject: [PATCH 33/91] Ran prettier --- .github/workflows/test-macos.yml | 18 +++++++++--------- .github/workflows/test-windows.yml | 26 +++++++++++++------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 0acece0c684..bf1f977ffae 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -30,17 +30,17 @@ jobs: C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }} - steps: - - name: Force LTO - if: matrix.force-lto - run: | - echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV" + steps: + - name: Force LTO + if: matrix.force-lto + run: | + echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV" shell: bash - - name: Enable plugin support - if: matrix.plugins - run: | - echo "C2_PLUGINS=ON" >> "$GITHUB_ENV" + - name: Enable plugin support + if: matrix.plugins + run: | + echo "C2_PLUGINS=ON" >> "$GITHUB_ENV" shell: bash - name: Set BUILD_WITH_QT6 diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 215bf340427..9e8f0993606 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -35,23 +35,23 @@ jobs: C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }} - steps: - - name: Force LTO - if: matrix.force-lto - run: | - echo "C2_ENABLE_LTO=ON" >> "$Env:GITHUB_ENV" + steps: + - name: Force LTO + if: matrix.force-lto + run: | + echo "C2_ENABLE_LTO=ON" >> "$Env:GITHUB_ENV" shell: pwsh - - name: Enable plugin support - if: matrix.plugins - run: | - echo "C2_PLUGINS=ON" >> "$Env:GITHUB_ENV" + - name: Enable plugin support + if: matrix.plugins + run: | + echo "C2_PLUGINS=ON" >> "$Env:GITHUB_ENV" shell: pwsh - - name: Set Crashpad - if: matrix.skip-crashpad == false - run: | - echo "C2_ENABLE_CRASHPAD=ON" >> "$Env:GITHUB_ENV" + - name: Set Crashpad + if: matrix.skip-crashpad == false + run: | + echo "C2_ENABLE_CRASHPAD=ON" >> "$Env:GITHUB_ENV" shell: pwsh - name: Set environment variables for windows-latest From 46752b9ddbda235ce262593fb985594abae6d015 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:26:31 +0100 Subject: [PATCH 34/91] Hopefully fix windows test workflow --- .github/workflows/test-windows.yml | 39 +++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 9e8f0993606..d9072591f65 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -158,14 +158,45 @@ jobs: nmake /S /NOLOGO working-directory: build-test + - name: Checkout Twitch PubSub Server Test + if: startsWith(matrix.os, 'windows') + use: actions/checkout@v4 + with: + - repository: 'Chatterino/twitch-pubsub-server-test' + - path: 'pubsub-server-test' + + - name: Build and run Twitch PubSub Server Test + if: startsWith(matrix.os, 'windows') + timeout-minutes: 30 + run: | + cd src/cmd/server + go build + cp server ../../../ + cp server.crt ../../../ + cp server.key ../../../ + cd ../../.. + ./server 127.0.0.1:9050 & + working-directory: pubsub-server-test + shell: pwsh + + - name: Checkout httpbin + if: startsWith(matrix.os, 'windows') + run: | + git clone https://gitlab.com/kennethreitz/httpbin.git httpbin + + - name: Build and run httpbin + if: startsWith(matrix.os, 'windows') + timeout-minutes: 30 + run: | + pip3 install -r Pipfile + gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & + working-directory: httpbin + shell: pwsh + - name: Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - 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 ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe working-directory: build-test shell: pwsh From c7a1168a1d2e0088a40052dbe1d9273da7119c44 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:52:41 +0100 Subject: [PATCH 35/91] Fix typo in uses (use -> uses) --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index d9072591f65..bd0dc57d4cd 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -160,7 +160,7 @@ jobs: - name: Checkout Twitch PubSub Server Test if: startsWith(matrix.os, 'windows') - use: actions/checkout@v4 + uses: actions/checkout@v4 with: - repository: 'Chatterino/twitch-pubsub-server-test' - path: 'pubsub-server-test' From d85d948270d8fe5f21e758216946ac0668dfeb41 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:54:17 +0100 Subject: [PATCH 36/91] Remove unnecessary hyphens --- .github/workflows/test-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index bd0dc57d4cd..abaf88753fb 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -162,8 +162,8 @@ jobs: if: startsWith(matrix.os, 'windows') uses: actions/checkout@v4 with: - - repository: 'Chatterino/twitch-pubsub-server-test' - - path: 'pubsub-server-test' + repository: 'Chatterino/twitch-pubsub-server-test' + path: 'pubsub-server-test' - name: Build and run Twitch PubSub Server Test if: startsWith(matrix.os, 'windows') From b234620c41a70a83f0c3692f33e16e25ec63a532 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 08:58:40 +0100 Subject: [PATCH 37/91] Remove src from pubsub server test build and run --- .github/workflows/test-windows.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index abaf88753fb..01e63850c30 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -169,12 +169,12 @@ jobs: if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - cd src/cmd/server + cd cmd/server go build - cp server ../../../ - cp server.crt ../../../ - cp server.key ../../../ - cd ../../.. + cp server ../../ + cp server.crt ../../ + cp server.key ../../ + cd ../.. ./server 127.0.0.1:9050 & working-directory: pubsub-server-test shell: pwsh From 7b6b32351b17f65dd96452d8ff17280b60d1a05c Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:25:26 +0100 Subject: [PATCH 38/91] list directory contents for pubsub-server-test to find out where the problem is --- .github/workflows/test-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 01e63850c30..859a05d0a25 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -171,6 +171,8 @@ jobs: run: | cd cmd/server go build + ls -la + tree ../.. cp server ../../ cp server.crt ../../ cp server.key ../../ From ea3a3cb48d12c48dd1c0ade52f6d052220fb958f Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:58:00 +0100 Subject: [PATCH 39/91] Remove `-la` because pwsh doesn't understand that --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 859a05d0a25..de629bfa94a 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -171,7 +171,7 @@ jobs: run: | cd cmd/server go build - ls -la + ls tree ../.. cp server ../../ cp server.crt ../../ From efee6ea2e26c954753317728702ead0895188725 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:51:54 +0100 Subject: [PATCH 40/91] Add `.exe` to the executable file of pubsub test --- .github/workflows/test-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index de629bfa94a..ea51eae450d 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -171,13 +171,13 @@ jobs: run: | cd cmd/server go build - ls + ls ../.. tree ../.. - cp server ../../ + cp server.exe ../../ cp server.crt ../../ cp server.key ../../ cd ../.. - ./server 127.0.0.1:9050 & + ./server.exe 127.0.0.1:9050 & working-directory: pubsub-server-test shell: pwsh From 9f4f381fb1bc601d25d34ab8e26b4b9c39b11fa0 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:34:06 +0100 Subject: [PATCH 41/91] Remove ls and tree from pubsub server test --- .github/workflows/test-windows.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index ea51eae450d..c4a3feb2960 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -1,5 +1,3 @@ ---- -name: Test Windows on: pull_request: @@ -171,8 +169,6 @@ jobs: run: | cd cmd/server go build - ls ../.. - tree ../.. cp server.exe ../../ cp server.crt ../../ cp server.key ../../ @@ -207,3 +203,4 @@ jobs: if: startsWith(matrix.os, 'windows') run: conan cache clean --source --build --download "*" shell: pwsh + From b15ce7a93a2032fe6e97a7cb3f863196d500e8b7 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:40:14 +0100 Subject: [PATCH 42/91] Use pipenv --- .github/workflows/test-windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index c4a3feb2960..da2f9e5beac 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -186,7 +186,8 @@ jobs: if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - pip3 install -r Pipfile + pip3 install pipenv + pip3 install --no-cache-dir -r < pipenv lock -r gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & working-directory: httpbin shell: pwsh From 884f107fae492b198c30b0dc90cae03142febd13 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:42:08 +0100 Subject: [PATCH 43/91] Name Windows test file --- .github/workflows/test-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index da2f9e5beac..93f0b43c9a0 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -1,3 +1,5 @@ +--- +name: Test Windows on: pull_request: From a917f68d5b960668ad6630380f1ff1b22b59737d Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:08:23 +0100 Subject: [PATCH 44/91] Replace `<` by `|` for redirecting stdout of pipenv to stdin of pip3 --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 93f0b43c9a0..3c0bb7f5113 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -189,7 +189,7 @@ jobs: timeout-minutes: 30 run: | pip3 install pipenv - pip3 install --no-cache-dir -r < pipenv lock -r + pipenv lock -r | pip3 install --no-cache-dir -r gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & working-directory: httpbin shell: pwsh From 45484935f582ae508edf6c8ee297e5093f2519cd Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:36:56 +0100 Subject: [PATCH 45/91] Change to pipenv install --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 3c0bb7f5113..fd3d47cdfee 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -189,7 +189,7 @@ jobs: timeout-minutes: 30 run: | pip3 install pipenv - pipenv lock -r | pip3 install --no-cache-dir -r + pipenv install gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & working-directory: httpbin shell: pwsh From 6ede3f81d3b2e84d4624acc6238ccea2a316c543 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:29:46 +0100 Subject: [PATCH 46/91] Add `pipenv lock -r` before installing Pipfile --- .github/workflows/test-windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index fd3d47cdfee..42b0ab7a9b7 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -188,7 +188,8 @@ jobs: if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - pip3 install pipenv + pip3 install --no-cache-dir pipenv + pipenv lock -r pipenv install gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & working-directory: httpbin From dcc6d2ea6ce4cb6d1fb5448947d170180012b47e Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:57:54 +0100 Subject: [PATCH 47/91] Try `pipenv sync` before `pipenv install` --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 42b0ab7a9b7..3c8f66605e2 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -189,7 +189,7 @@ jobs: timeout-minutes: 30 run: | pip3 install --no-cache-dir pipenv - pipenv lock -r + pipenv sync pipenv install gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & working-directory: httpbin From 098ff8da54b595f8b82dae1cb86cc0e863093667 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:29:48 +0100 Subject: [PATCH 48/91] Add name to Pipfile with pwsh logic --- .github/workflows/test-windows.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 3c8f66605e2..0bd15915814 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -189,7 +189,10 @@ jobs: timeout-minutes: 30 run: | pip3 install --no-cache-dir pipenv - pipenv sync + $pipFile = (Get-Content Pipfile) -as [Collections.ArrayList] + $pipFile.Insert(1, 'name = "PyPi"') + $pipFile | Set-Content Pipfile + echo $pipFile pipenv install gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & working-directory: httpbin From e8ed29e8f91d962247a76e2bbdb0f9c9cd2bd595 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 4 Nov 2023 22:11:40 +0100 Subject: [PATCH 49/91] Upgrade to `macos-13` runner image to see if that fixes the problem with the test cpps --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index bf1f977ffae..6d8be584d01 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest] + os: [macos-13] qt-version: [5.15.2, 6.2.4] force-lto: [false] plugins: [false] From 3fb29e2bf55010f6136e7cd8cfdf71728b638ff0 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 4 Nov 2023 22:51:28 +0100 Subject: [PATCH 50/91] Download pubsub-server-test binaries instead of building it everytime --- .github/workflows/test-windows.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 0bd15915814..4ebc206cf86 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -158,23 +158,20 @@ jobs: nmake /S /NOLOGO working-directory: build-test - - name: Checkout Twitch PubSub Server Test + - name: Download and extract Twitch PubSub Server Test if: startsWith(matrix.os, 'windows') - uses: actions/checkout@v4 - with: - repository: 'Chatterino/twitch-pubsub-server-test' - path: 'pubsub-server-test' + run: | + mkdir pubsub-server-test + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/v1.0.7/server-v1.0.7-windows-amd64.zip" -outfile "pubsub-server.zip" + Expand-Archive pubsub-server.zip -DestinationPath pubsub-server-test + rm pubsub-server.zip + shell: pwsh - - name: Build and run Twitch PubSub Server Test + - name: Run Twitch PubSub Server Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - cd cmd/server - go build - cp server.exe ../../ - cp server.crt ../../ - cp server.key ../../ - cd ../.. + ls ./server.exe 127.0.0.1:9050 & working-directory: pubsub-server-test shell: pwsh @@ -210,4 +207,3 @@ jobs: if: startsWith(matrix.os, 'windows') run: conan cache clean --source --build --download "*" shell: pwsh - From baaa52f4bb41b66cd25c88450b80309201ab1d9d Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 4 Nov 2023 23:25:00 +0100 Subject: [PATCH 51/91] Use `duskmoon314/httpbin-rs` instead of the old httpbin --- .clang-tidy | 3 + .github/workflows/build.yml | 1 + .github/workflows/test-windows.yml | 33 +- CHANGELOG.md | 4 + CMakeLists.txt | 6 +- cmake/resources/generate_resources.cmake | 12 +- cmake/resources/windows.rc.in | 34 +++ resources/windows.rc | 1 - src/CMakeLists.txt | 10 +- .../commands/CommandController.cpp | 287 +----------------- .../commands/builtin/twitch/Ban.cpp | 285 +++++++++++++++++ .../commands/builtin/twitch/Ban.hpp | 21 ++ src/providers/twitch/TwitchAccount.cpp | 38 ++- src/providers/twitch/TwitchAccount.hpp | 2 + src/singletons/WindowManager.cpp | 6 - src/singletons/WindowManager.hpp | 5 - src/widgets/TooltipEntryWidget.cpp | 5 + src/widgets/TooltipWidget.cpp | 44 ++- src/widgets/helper/EditableModelView.cpp | 1 + .../settingspages/KeyboardSettingsPage.cpp | 61 ++-- .../settingspages/KeyboardSettingsPage.hpp | 4 - 21 files changed, 490 insertions(+), 373 deletions(-) create mode 100644 cmake/resources/windows.rc.in delete mode 100644 resources/windows.rc create mode 100644 src/controllers/commands/builtin/twitch/Ban.cpp create mode 100644 src/controllers/commands/builtin/twitch/Ban.hpp diff --git a/.clang-tidy b/.clang-tidy index 5d3a0d09ea3..658f661392a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -63,3 +63,6 @@ CheckOptions: # Lua state - key: readability-identifier-naming.LocalPointerIgnoredRegexp value: ^L$ + + - key: misc-const-correctness.AnalyzeValues + value: false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38321ab54bd..30870797852 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -331,6 +331,7 @@ jobs: - name: clang-tidy review if: matrix.clang-tidy-review && github.event_name == 'pull_request' + timeout-minutes: 10 uses: ZedThree/clang-tidy-review@v0.14.0 with: build_dir: build-clang-tidy diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 4ebc206cf86..249a25de7ff 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -167,38 +167,21 @@ jobs: rm pubsub-server.zip shell: pwsh - - name: Run Twitch PubSub Server Test - if: startsWith(matrix.os, 'windows') - timeout-minutes: 30 - run: | - ls - ./server.exe 127.0.0.1:9050 & - working-directory: pubsub-server-test - shell: pwsh - - name: Checkout httpbin if: startsWith(matrix.os, 'windows') - run: | - git clone https://gitlab.com/kennethreitz/httpbin.git httpbin - - - name: Build and run httpbin - if: startsWith(matrix.os, 'windows') - timeout-minutes: 30 - run: | - pip3 install --no-cache-dir pipenv - $pipFile = (Get-Content Pipfile) -as [Collections.ArrayList] - $pipFile.Insert(1, 'name = "PyPi"') - $pipFile | Set-Content Pipfile - echo $pipFile - pipenv install - gunicorn -b 0.0.0.0:80 httpbin:app -k gevent & - working-directory: httpbin - shell: pwsh + uses: actions/checkout@v4 + with: + repository: "duskmoon314/httpbin-rs" + path: "httpbin" - name: Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | + cd ../httpbin + cargo run & + cd ../../build-test + ./pubsub-server-test/server.exe 127.0.0.1:9050 & ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe working-directory: build-test shell: pwsh diff --git a/CHANGELOG.md b/CHANGELOG.md index 4555e262795..461bfd8e5c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unversioned +- Major: Allow use of Twitch follower emotes in other channels if subscribed. (#4922) - Minor: Migrate to the new Get Channel Followers Helix endpoint, fixing follower count not showing up in usercards. (#4809) - Minor: The account switcher is now styled to match your theme. (#4817) - Minor: Add an invisible resize handle to the bottom of frameless user info popups and reply thread popups. (#4795) @@ -24,6 +25,8 @@ - Bugfix: Fixed the input completion popup from disappearing when clicking on it on Windows and macOS. (#4876) - Bugfix: Fixed double-click text selection moving its position with each new message. (#4898) - Bugfix: Fixed an issue where notifications on Windows would contain no or an old avatar. (#4899) +- Bugfix: Fixed headers of tables in the settings switching to bold text when selected. (#4913) +- Bugfix: Fixed tooltips appearing too large and/or away from the cursor. (#4920) - Bugfix: Fixed a crash when clicking `More messages below` button in a usercard and closing it quickly. (#4933) - Dev: Change clang-format from v14 to v16. (#4929) - Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791) @@ -49,6 +52,7 @@ - Dev: Changed lifetime of context menus. (#4924) - Dev: Refactor `ChannelView`, removing a bunch of clang-tidy warnings. (#4926) - Dev: Refactor `IrcMessageHandler`, removing a bunch of clang-tidy warnings & changing its public API. (#4927) +- Dev: `Details` file properties tab is now populated on Windows. (#4912) ## 2.4.6 diff --git a/CMakeLists.txt b/CMakeLists.txt index 58ffbffb383..7e74581b692 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,11 @@ if(BUILD_BENCHMARKS) list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks") endif() -project(chatterino VERSION 2.4.6) +project(chatterino + VERSION 2.4.6 + DESCRIPTION "Chat client for twitch.tv" + HOMEPAGE_URL "https://chatterino.com/" +) if(CHATTERINO_LTO) include(CheckIPOSupported) diff --git a/cmake/resources/generate_resources.cmake b/cmake/resources/generate_resources.cmake index d9ceccad26c..e6c8c8d816e 100644 --- a/cmake/resources/generate_resources.cmake +++ b/cmake/resources/generate_resources.cmake @@ -6,7 +6,6 @@ set( qt.conf resources.qrc resources_autogenerated.qrc - windows.rc themes/ChatterinoTheme.schema.json ) set(RES_IMAGE_EXCLUDE_FILTER ^linuxinstall/) @@ -78,7 +77,16 @@ endforeach () list(JOIN RES_HEADER_CONTENT "\n" RES_HEADER_CONTENT) configure_file(${CMAKE_CURRENT_LIST_DIR}/ResourcesAutogen.hpp.in ${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.hpp @ONLY) -set(RES_AUTOGEN_FILES +if (WIN32) + if (NOT PROJECT_VERSION_TWEAK) + set(PROJECT_VERSION_TWEAK 0) + endif() + string(TIMESTAMP CURRENT_YEAR "%Y") + configure_file(${CMAKE_CURRENT_LIST_DIR}/windows.rc.in ${CMAKE_BINARY_DIR}/autogen/windows.rc @ONLY) + list(APPEND RES_AUTOGEN_FILES "${CMAKE_BINARY_DIR}/autogen/windows.rc") +endif () + +list(APPEND RES_AUTOGEN_FILES "${CMAKE_SOURCE_DIR}/resources/resources_autogenerated.qrc" "${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.cpp" "${CMAKE_BINARY_DIR}/autogen/ResourcesAutogen.hpp" diff --git a/cmake/resources/windows.rc.in b/cmake/resources/windows.rc.in new file mode 100644 index 00000000000..a43cb8810e2 --- /dev/null +++ b/cmake/resources/windows.rc.in @@ -0,0 +1,34 @@ +#include + +IDI_ICON1 ICON "@RES_DIR@/icon.ico" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@PROJECT_VERSION_TWEAK@ + PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@PROJECT_VERSION_TWEAK@ + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS VS_FF_SPECIALBUILD + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "ProductName", "Chatterino" + VALUE "ProductVersion", "@PROJECT_VERSION@" + VALUE "CompanyName", "Chatterino, @PROJECT_HOMEPAGE_URL@" + VALUE "FileDescription", "Chatterino" + VALUE "FileVersion", "@PROJECT_VERSION@" + VALUE "SpecialBuild", "@GIT_COMMIT@" + VALUE "InternalName", "Chatterino" + VALUE "OriginalFilename", "Chatterino" + VALUE "LegalCopyright", "Project contributors 2016-@CURRENT_YEAR@" + VALUE "Licence", "MIT" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END \ No newline at end of file diff --git a/resources/windows.rc b/resources/windows.rc deleted file mode 100644 index 8f9d9ca03e6..00000000000 --- a/resources/windows.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "icon.ico" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ed4bf4c7e6..84a6df64ab5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,6 +65,8 @@ set(SOURCE_FILES controllers/commands/builtin/twitch/ShieldMode.hpp controllers/commands/builtin/twitch/Shoutout.cpp controllers/commands/builtin/twitch/Shoutout.hpp + controllers/commands/builtin/twitch/Ban.cpp + controllers/commands/builtin/twitch/Ban.hpp controllers/commands/CommandContext.hpp controllers/commands/CommandController.cpp controllers/commands/CommandController.hpp @@ -646,13 +648,7 @@ set(SOURCE_FILES ${CMAKE_SOURCE_DIR}/resources/resources.qrc ) -if (WIN32) - # clang-cl doesn't support resource files - if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") - list(APPEND SOURCE_FILES "${CMAKE_SOURCE_DIR}/resources/windows.rc") - endif () - -elseif (APPLE) +if (APPLE) set(MACOS_BUNDLE_ICON_FILE "${CMAKE_SOURCE_DIR}/resources/chatterino.icns") list(APPEND SOURCE_FILES "${MACOS_BUNDLE_ICON_FILE}") set_source_files_properties(${MACOS_BUNDLE_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index 6f69cabf63e..1c3cce54e5a 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -8,6 +8,7 @@ #include "common/SignalVector.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/commands/builtin/chatterino/Debugging.hpp" +#include "controllers/commands/builtin/twitch/Ban.hpp" #include "controllers/commands/builtin/twitch/ChatSettings.hpp" #include "controllers/commands/builtin/twitch/ShieldMode.hpp" #include "controllers/commands/builtin/twitch/Shoutout.hpp" @@ -2293,17 +2294,6 @@ void CommandController::initialize(Settings &, Paths &paths) return ""; }); - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch auto unbanLambda = [](auto words, auto channel) { auto commandName = words.at(0).toLower(); auto *twitchChannel = dynamic_cast(channel.get()); @@ -2411,27 +2401,17 @@ void CommandController::initialize(Settings &, Paths &paths) }); return ""; - }; // These changes are from the helix-command-migration/unban-untimeout branch + }; - this->registerCommand("/unban", [unbanLambda](const QStringList &words, - auto channel) { - return unbanLambda(words, channel); - }); // These changes are from the helix-command-migration/unban-untimeout branch + this->registerCommand( + "/unban", [unbanLambda](const QStringList &words, auto channel) { + return unbanLambda(words, channel); + }); - this->registerCommand("/untimeout", [unbanLambda](const QStringList &words, - auto channel) { - return unbanLambda(words, channel); - }); // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch - // These changes are from the helix-command-migration/unban-untimeout branch + this->registerCommand( + "/untimeout", [unbanLambda](const QStringList &words, auto channel) { + return unbanLambda(words, channel); + }); this->registerCommand( // /raid "/raid", [](const QStringList &words, auto channel) -> QString { @@ -2677,251 +2657,10 @@ void CommandController::initialize(Settings &, Paths &paths) this->registerCommand("/uniquechatoff", &commands::uniqueChatOff); this->registerCommand("/r9kbetaoff", &commands::uniqueChatOff); - auto formatBanTimeoutError = - [](const char *operation, HelixBanUserError error, - const QString &message, const QString &userTarget) -> QString { - using Error = HelixBanUserError; - - QString errorMessage = QString("Failed to %1 user - ").arg(operation); - - switch (error) - { - case Error::ConflictingOperation: { - errorMessage += "There was a conflicting ban operation on " - "this user. Please try again."; - } - break; - - case Error::Forwarded: { - errorMessage += message; - } - break; - - case Error::Ratelimited: { - errorMessage += "You are being ratelimited by Twitch. Try " - "again in a few seconds."; - } - break; - - case Error::TargetBanned: { - // Equivalent IRC error - errorMessage += QString("%1 is already banned in this channel.") - .arg(userTarget); - } - break; - - case Error::CannotBanUser: { - // We can't provide the identical error as in IRC, - // because we don't have enough information about the user. - // The messages from IRC are formatted like this: - // "You cannot {op} moderator {mod} unless you are the owner of this channel." - // "You cannot {op} the broadcaster." - errorMessage += - QString("You cannot %1 %2.").arg(operation, userTarget); - } - break; - - case Error::UserMissingScope: { - // TODO(pajlada): Phrase MISSING_REQUIRED_SCOPE - errorMessage += "Missing required scope. " - "Re-login with your " - "account and try again."; - } - break; - - case Error::UserNotAuthorized: { - // TODO(pajlada): Phrase MISSING_PERMISSION - errorMessage += "You don't have permission to " - "perform that action."; - } - break; - - case Error::Unknown: { - errorMessage += "An unknown error has occurred."; - } - break; - } - return errorMessage; - }; - - this->registerCommand("/timeout", [formatBanTimeoutError]( - const QStringList &words, - auto channel) { - auto *twitchChannel = dynamic_cast(channel.get()); - if (twitchChannel == nullptr) - { - channel->addMessage(makeSystemMessage( - QString("The /timeout command only works in Twitch channels"))); - return ""; - } - const auto *usageStr = - "Usage: \"/timeout [duration][time unit] [reason]\" - " - "Temporarily prevent a user from chatting. Duration (optional, " - "default=10 minutes) must be a positive integer; time unit " - "(optional, default=s) must be one of s, m, h, d, w; maximum " - "duration is 2 weeks. Combinations like 1d2h are also allowed. " - "Reason is optional and will be shown to the target user and other " - "moderators. Use \"/untimeout\" to remove a timeout."; - if (words.size() < 2) - { - channel->addMessage(makeSystemMessage(usageStr)); - return ""; - } - - auto currentUser = getApp()->accounts->twitch.getCurrent(); - if (currentUser->isAnon()) - { - channel->addMessage( - makeSystemMessage("You must be logged in to timeout someone!")); - return ""; - } - - auto target = words.at(1); - stripChannelName(target); - - int duration = 10 * 60; // 10min - if (words.size() >= 3) - { - duration = (int)parseDurationToSeconds(words.at(2)); - if (duration <= 0) - { - channel->addMessage(makeSystemMessage(usageStr)); - return ""; - } - } - auto reason = words.mid(3).join(' '); - - getHelix()->getUserByName( - target, - [channel, currentUser, twitchChannel, target, duration, reason, - formatBanTimeoutError](const auto &targetUser) { - getHelix()->banUser( - twitchChannel->roomId(), currentUser->getUserId(), - targetUser.id, duration, reason, - [] { - // No response for timeouts, they're emitted over pubsub/IRC instead - }, - [channel, target, targetUser, formatBanTimeoutError]( - auto error, auto message) { - auto errorMessage = formatBanTimeoutError( - "timeout", error, message, targetUser.displayName); - channel->addMessage(makeSystemMessage(errorMessage)); - }); - }, - [channel, target] { - // Equivalent error from IRC - channel->addMessage(makeSystemMessage( - QString("Invalid username: %1").arg(target))); - }); - - return ""; - }); - - this->registerCommand("/ban", [formatBanTimeoutError]( - const QStringList &words, auto channel) { - auto *twitchChannel = dynamic_cast(channel.get()); - if (twitchChannel == nullptr) - { - channel->addMessage(makeSystemMessage( - QString("The /ban command only works in Twitch channels"))); - return ""; - } - - const auto *usageStr = - "Usage: \"/ban [reason]\" - Permanently prevent a user " - "from chatting. Reason is optional and will be shown to the target " - "user and other moderators. Use \"/unban\" to remove a ban."; - if (words.size() < 2) - { - channel->addMessage(makeSystemMessage(usageStr)); - return ""; - } + this->registerCommand("/timeout", &commands::sendTimeout); - auto currentUser = getApp()->accounts->twitch.getCurrent(); - if (currentUser->isAnon()) - { - channel->addMessage( - makeSystemMessage("You must be logged in to ban someone!")); - return ""; - } - - auto target = words.at(1); - stripChannelName(target); - - auto reason = words.mid(2).join(' '); - - getHelix()->getUserByName( - target, - [channel, currentUser, twitchChannel, target, reason, - formatBanTimeoutError](const auto &targetUser) { - getHelix()->banUser( - twitchChannel->roomId(), currentUser->getUserId(), - targetUser.id, std::nullopt, reason, - [] { - // No response for bans, they're emitted over pubsub/IRC instead - }, - [channel, target, targetUser, formatBanTimeoutError]( - auto error, auto message) { - auto errorMessage = formatBanTimeoutError( - "ban", error, message, targetUser.displayName); - channel->addMessage(makeSystemMessage(errorMessage)); - }); - }, - [channel, target] { - // Equivalent error from IRC - channel->addMessage(makeSystemMessage( - QString("Invalid username: %1").arg(target))); - }); - - return ""; - }); - - this->registerCommand("/banid", [formatBanTimeoutError]( - const QStringList &words, - auto channel) { - auto *twitchChannel = dynamic_cast(channel.get()); - if (twitchChannel == nullptr) - { - channel->addMessage(makeSystemMessage( - QString("The /banid command only works in Twitch channels"))); - return ""; - } - - const auto *usageStr = - "Usage: \"/banid [reason]\" - Permanently prevent a user " - "from chatting via their user ID. Reason is optional and will be " - "shown to the target user and other moderators."; - if (words.size() < 2) - { - channel->addMessage(makeSystemMessage(usageStr)); - return ""; - } - - auto currentUser = getApp()->accounts->twitch.getCurrent(); - if (currentUser->isAnon()) - { - channel->addMessage( - makeSystemMessage("You must be logged in to ban someone!")); - return ""; - } - - auto target = words.at(1); - auto reason = words.mid(2).join(' '); - - getHelix()->banUser( - twitchChannel->roomId(), currentUser->getUserId(), target, - std::nullopt, reason, - [] { - // No response for bans, they're emitted over pubsub/IRC instead - }, - [channel, target, formatBanTimeoutError](auto error, auto message) { - auto errorMessage = - formatBanTimeoutError("ban", error, message, "#" + target); - channel->addMessage(makeSystemMessage(errorMessage)); - }); - - return ""; - }); + this->registerCommand("/ban", &commands::sendBan); + this->registerCommand("/banid", &commands::sendBanById); for (const auto &cmd : TWITCH_WHISPER_COMMANDS) { diff --git a/src/controllers/commands/builtin/twitch/Ban.cpp b/src/controllers/commands/builtin/twitch/Ban.cpp new file mode 100644 index 00000000000..8c438539e43 --- /dev/null +++ b/src/controllers/commands/builtin/twitch/Ban.cpp @@ -0,0 +1,285 @@ +#include "controllers/commands/builtin/twitch/Ban.hpp" + +#include "Application.hpp" +#include "controllers/accounts/AccountController.hpp" +#include "controllers/commands/CommandContext.hpp" +#include "messages/MessageBuilder.hpp" +#include "providers/twitch/api/Helix.hpp" +#include "providers/twitch/TwitchAccount.hpp" +#include "providers/twitch/TwitchChannel.hpp" +#include "util/Twitch.hpp" + +namespace { + +using namespace chatterino; + +QString formatBanTimeoutError(const char *operation, HelixBanUserError error, + const QString &message, const QString &userTarget) +{ + using Error = HelixBanUserError; + + QString errorMessage = QString("Failed to %1 user - ").arg(operation); + + switch (error) + { + case Error::ConflictingOperation: { + errorMessage += "There was a conflicting ban operation on " + "this user. Please try again."; + } + break; + + case Error::Forwarded: { + errorMessage += message; + } + break; + + case Error::Ratelimited: { + errorMessage += "You are being ratelimited by Twitch. Try " + "again in a few seconds."; + } + break; + + case Error::TargetBanned: { + // Equivalent IRC error + errorMessage += QString("%1 is already banned in this channel.") + .arg(userTarget); + } + break; + + case Error::CannotBanUser: { + // We can't provide the identical error as in IRC, + // because we don't have enough information about the user. + // The messages from IRC are formatted like this: + // "You cannot {op} moderator {mod} unless you are the owner of this channel." + // "You cannot {op} the broadcaster." + errorMessage += + QString("You cannot %1 %2.").arg(operation, userTarget); + } + break; + + case Error::UserMissingScope: { + // TODO(pajlada): Phrase MISSING_REQUIRED_SCOPE + errorMessage += "Missing required scope. " + "Re-login with your " + "account and try again."; + } + break; + + case Error::UserNotAuthorized: { + // TODO(pajlada): Phrase MISSING_PERMISSION + errorMessage += "You don't have permission to " + "perform that action."; + } + break; + + case Error::Unknown: { + errorMessage += "An unknown error has occurred."; + } + break; + } + return errorMessage; +}; + +} // namespace + +namespace chatterino::commands { + +QString sendBan(const CommandContext &ctx) +{ + const auto &words = ctx.words; + const auto &channel = ctx.channel; + const auto *twitchChannel = ctx.twitchChannel; + + if (channel == nullptr) + { + return ""; + } + + if (twitchChannel == nullptr) + { + channel->addMessage(makeSystemMessage( + QString("The /ban command only works in Twitch channels"))); + return ""; + } + + const auto *usageStr = + "Usage: \"/ban [reason]\" - Permanently prevent a user " + "from chatting. Reason is optional and will be shown to the target " + "user and other moderators. Use \"/unban\" to remove a ban."; + if (words.size() < 2) + { + channel->addMessage(makeSystemMessage(usageStr)); + return ""; + } + + auto currentUser = getApp()->accounts->twitch.getCurrent(); + if (currentUser->isAnon()) + { + channel->addMessage( + makeSystemMessage("You must be logged in to ban someone!")); + return ""; + } + + auto target = words.at(1); + stripChannelName(target); + + auto reason = words.mid(2).join(' '); + + getHelix()->getUserByName( + target, + [channel, currentUser, twitchChannel, target, + reason](const auto &targetUser) { + getHelix()->banUser( + twitchChannel->roomId(), currentUser->getUserId(), + targetUser.id, std::nullopt, reason, + [] { + // No response for bans, they're emitted over pubsub/IRC instead + }, + [channel, target, targetUser](auto error, auto message) { + auto errorMessage = formatBanTimeoutError( + "ban", error, message, targetUser.displayName); + channel->addMessage(makeSystemMessage(errorMessage)); + }); + }, + [channel, target] { + // Equivalent error from IRC + channel->addMessage( + makeSystemMessage(QString("Invalid username: %1").arg(target))); + }); + + return ""; +} + +QString sendBanById(const CommandContext &ctx) +{ + const auto &words = ctx.words; + const auto &channel = ctx.channel; + const auto *twitchChannel = ctx.twitchChannel; + + if (channel == nullptr) + { + return ""; + } + if (twitchChannel == nullptr) + { + channel->addMessage(makeSystemMessage( + QString("The /banid command only works in Twitch channels"))); + return ""; + } + + const auto *usageStr = + "Usage: \"/banid [reason]\" - Permanently prevent a user " + "from chatting via their user ID. Reason is optional and will be " + "shown to the target user and other moderators."; + if (words.size() < 2) + { + channel->addMessage(makeSystemMessage(usageStr)); + return ""; + } + + auto currentUser = getApp()->accounts->twitch.getCurrent(); + if (currentUser->isAnon()) + { + channel->addMessage( + makeSystemMessage("You must be logged in to ban someone!")); + return ""; + } + + auto target = words.at(1); + auto reason = words.mid(2).join(' '); + + getHelix()->banUser( + twitchChannel->roomId(), currentUser->getUserId(), target, std::nullopt, + reason, + [] { + // No response for bans, they're emitted over pubsub/IRC instead + }, + [channel, target](auto error, auto message) { + auto errorMessage = + formatBanTimeoutError("ban", error, message, "#" + target); + channel->addMessage(makeSystemMessage(errorMessage)); + }); + + return ""; +} + +QString sendTimeout(const CommandContext &ctx) +{ + const auto &words = ctx.words; + const auto &channel = ctx.channel; + const auto *twitchChannel = ctx.twitchChannel; + + if (channel == nullptr) + { + return ""; + } + + if (twitchChannel == nullptr) + { + channel->addMessage(makeSystemMessage( + QString("The /timeout command only works in Twitch channels"))); + return ""; + } + const auto *usageStr = + "Usage: \"/timeout [duration][time unit] [reason]\" - " + "Temporarily prevent a user from chatting. Duration (optional, " + "default=10 minutes) must be a positive integer; time unit " + "(optional, default=s) must be one of s, m, h, d, w; maximum " + "duration is 2 weeks. Combinations like 1d2h are also allowed. " + "Reason is optional and will be shown to the target user and other " + "moderators. Use \"/untimeout\" to remove a timeout."; + if (words.size() < 2) + { + channel->addMessage(makeSystemMessage(usageStr)); + return ""; + } + + auto currentUser = getApp()->accounts->twitch.getCurrent(); + if (currentUser->isAnon()) + { + channel->addMessage( + makeSystemMessage("You must be logged in to timeout someone!")); + return ""; + } + + auto target = words.at(1); + stripChannelName(target); + + int duration = 10 * 60; // 10min + if (words.size() >= 3) + { + duration = (int)parseDurationToSeconds(words.at(2)); + if (duration <= 0) + { + channel->addMessage(makeSystemMessage(usageStr)); + return ""; + } + } + auto reason = words.mid(3).join(' '); + + getHelix()->getUserByName( + target, + [channel, currentUser, twitchChannel, target, duration, + reason](const auto &targetUser) { + getHelix()->banUser( + twitchChannel->roomId(), currentUser->getUserId(), + targetUser.id, duration, reason, + [] { + // No response for timeouts, they're emitted over pubsub/IRC instead + }, + [channel, target, targetUser](auto error, auto message) { + auto errorMessage = formatBanTimeoutError( + "timeout", error, message, targetUser.displayName); + channel->addMessage(makeSystemMessage(errorMessage)); + }); + }, + [channel, target] { + // Equivalent error from IRC + channel->addMessage( + makeSystemMessage(QString("Invalid username: %1").arg(target))); + }); + + return ""; +} + +} // namespace chatterino::commands diff --git a/src/controllers/commands/builtin/twitch/Ban.hpp b/src/controllers/commands/builtin/twitch/Ban.hpp new file mode 100644 index 00000000000..9ba72491087 --- /dev/null +++ b/src/controllers/commands/builtin/twitch/Ban.hpp @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace chatterino { + +struct CommandContext; + +} // namespace chatterino + +namespace chatterino::commands { + +/// /ban +QString sendBan(const CommandContext &ctx); +/// /banid +QString sendBanById(const CommandContext &ctx); + +/// /timeout +QString sendTimeout(const CommandContext &ctx); + +} // namespace chatterino::commands diff --git a/src/providers/twitch/TwitchAccount.cpp b/src/providers/twitch/TwitchAccount.cpp index 6f597c46664..dc435fef47f 100644 --- a/src/providers/twitch/TwitchAccount.cpp +++ b/src/providers/twitch/TwitchAccount.cpp @@ -264,11 +264,32 @@ void TwitchAccount::loadUserstateEmotes(std::weak_ptr weakChannel) [this, weakChannel](QJsonArray emoteSetArray) { auto emoteData = this->emotes_.access(); auto localEmoteData = this->localEmotes_.access(); - for (auto emoteSet_ : emoteSetArray) + + std::unordered_set subscriberChannelIDs; + std::vector ivrEmoteSets; + ivrEmoteSets.reserve(emoteSetArray.size()); + + for (auto emoteSet : emoteSetArray) { - auto emoteSet = std::make_shared(); + IvrEmoteSet ivrEmoteSet(emoteSet.toObject()); + if (!ivrEmoteSet.tier.isNull()) + { + subscriberChannelIDs.insert(ivrEmoteSet.channelId); + } + ivrEmoteSets.emplace_back(ivrEmoteSet); + } + + for (const auto &emoteSet : emoteData->emoteSets) + { + if (emoteSet->subscriber) + { + subscriberChannelIDs.insert(emoteSet->channelID); + } + } - IvrEmoteSet ivrEmoteSet(emoteSet_.toObject()); + for (const auto &ivrEmoteSet : ivrEmoteSets) + { + auto emoteSet = std::make_shared(); QString setKey = ivrEmoteSet.setId; emoteSet->key = setKey; @@ -285,8 +306,15 @@ void TwitchAccount::loadUserstateEmotes(std::weak_ptr weakChannel) continue; } + emoteSet->channelID = ivrEmoteSet.channelId; emoteSet->channelName = ivrEmoteSet.login; emoteSet->text = ivrEmoteSet.displayName; + emoteSet->subscriber = !ivrEmoteSet.tier.isNull(); + + // NOTE: If a user does not have a subscriber emote set, but a follower emote set, this logic will be wrong + // However, that's not a realistic problem. + bool haveSubscriberSetForChannel = + subscriberChannelIDs.contains(ivrEmoteSet.channelId); for (const auto &emoteObj : ivrEmoteSet.emotes) { @@ -302,7 +330,9 @@ void TwitchAccount::loadUserstateEmotes(std::weak_ptr weakChannel) getApp()->emotes->twitch.getOrCreateEmote(id, code); // Follower emotes can be only used in their origin channel - if (ivrEmote.emoteType == "FOLLOWER") + // unless the user is subscribed, then they can be used anywhere. + if (ivrEmote.emoteType == "FOLLOWER" && + !haveSubscriberSetForChannel) { emoteSet->local = true; diff --git a/src/providers/twitch/TwitchAccount.hpp b/src/providers/twitch/TwitchAccount.hpp index e68624d0d9c..69032b80c9c 100644 --- a/src/providers/twitch/TwitchAccount.hpp +++ b/src/providers/twitch/TwitchAccount.hpp @@ -36,7 +36,9 @@ class TwitchAccount : public Account struct EmoteSet { QString key; QString channelName; + QString channelID; QString text; + bool subscriber{false}; bool local{false}; std::vector emotes; }; diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index 43188682290..a86fdbc5ac1 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -125,12 +125,6 @@ WindowManager::WindowManager() QObject::connect(this->saveTimer, &QTimer::timeout, [] { getApp()->windows->save(); }); - - this->miscUpdateTimer_.start(100); - - QObject::connect(&this->miscUpdateTimer_, &QTimer::timeout, [this] { - this->miscUpdate.invoke(); - }); } WindowManager::~WindowManager() = default; diff --git a/src/singletons/WindowManager.hpp b/src/singletons/WindowManager.hpp index 78b7b9e534f..22a68655cfb 100644 --- a/src/singletons/WindowManager.hpp +++ b/src/singletons/WindowManager.hpp @@ -122,10 +122,6 @@ class WindowManager final : public Singleton pajlada::Signals::NoArgSignal wordFlagsChanged; - // This signal fires every 100ms and can be used to trigger random things that require a recheck. - // It is currently being used by the "Tooltip Preview Image" system to recheck if an image is ready to be rendered. - pajlada::Signals::NoArgSignal miscUpdate; - pajlada::Signals::Signal selectSplit; pajlada::Signals::Signal selectSplitContainer; pajlada::Signals::Signal scrollToMessageSignal; @@ -159,7 +155,6 @@ class WindowManager final : public Singleton pajlada::SettingListener wordFlagsListener_; QTimer *saveTimer; - QTimer miscUpdateTimer_; friend class Window; // this is for selectedWindow_ }; diff --git a/src/widgets/TooltipEntryWidget.cpp b/src/widgets/TooltipEntryWidget.cpp index 6fbaec1fdd2..ff56928125e 100644 --- a/src/widgets/TooltipEntryWidget.cpp +++ b/src/widgets/TooltipEntryWidget.cpp @@ -91,6 +91,11 @@ bool TooltipEntryWidget::refreshPixmap() this->displayImage_->setPixmap(pixmap->scaled(this->customImgWidth_, this->customImgHeight_, Qt::KeepAspectRatio)); + if (this->displayImage_->size() != + QSize{this->customImgWidth_, this->customImgHeight_}) + { + this->adjustSize(); + } } else { diff --git a/src/widgets/TooltipWidget.cpp b/src/widgets/TooltipWidget.cpp index f979c03d28c..dba8afc77fb 100644 --- a/src/widgets/TooltipWidget.cpp +++ b/src/widgets/TooltipWidget.cpp @@ -37,11 +37,16 @@ TooltipWidget::TooltipWidget(BaseWidget *parent) }); this->updateFont(); - auto windows = getApp()->windows; + auto *windows = getApp()->windows; this->connections_.managedConnect(windows->gifRepaintRequested, [this] { + if (!this->isVisible()) + { + return; + } + for (int i = 0; i < this->visibleEntries_; ++i) { - auto entry = this->entryAt(i); + auto *entry = this->entryAt(i); if (entry && entry->animated()) { entry->refreshPixmap(); @@ -49,23 +54,29 @@ TooltipWidget::TooltipWidget(BaseWidget *parent) } }); - this->connections_.managedConnect(windows->miscUpdate, [this] { - bool needSizeAdjustment = false; - for (int i = 0; i < this->visibleEntries_; ++i) - { - auto entry = this->entryAt(i); - if (entry->hasImage() && entry->attemptRefresh()) + this->connections_.managedConnect( + windows->layoutRequested, [this](auto *chan) { + if (chan != nullptr || !this->isVisible()) { - bool successfullyUpdated = entry->refreshPixmap(); - needSizeAdjustment |= successfullyUpdated; + return; } - } - if (needSizeAdjustment) - { - this->adjustSize(); - } - }); + bool needSizeAdjustment = false; + for (int i = 0; i < this->visibleEntries_; ++i) + { + auto *entry = this->entryAt(i); + if (entry->hasImage() && entry->attemptRefresh()) + { + bool successfullyUpdated = entry->refreshPixmap(); + needSizeAdjustment |= successfullyUpdated; + } + } + + if (needSizeAdjustment) + { + this->adjustSize(); + } + }); } void TooltipWidget::setOne(const TooltipEntry &entry, TooltipStyle style) @@ -101,6 +112,7 @@ void TooltipWidget::set(const std::vector &entries, entryWidget->setImageScale(entry.customWidth, entry.customHeight); } } + this->adjustSize(); } void TooltipWidget::setVisibleEntries(int n) diff --git a/src/widgets/helper/EditableModelView.cpp b/src/widgets/helper/EditableModelView.cpp index 97c6840b8d4..20a618bd704 100644 --- a/src/widgets/helper/EditableModelView.cpp +++ b/src/widgets/helper/EditableModelView.cpp @@ -26,6 +26,7 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable) this->tableView_->setDragDropOverwriteMode(false); this->tableView_->setDefaultDropAction(Qt::DropAction::MoveAction); this->tableView_->verticalHeader()->setVisible(false); + this->tableView_->horizontalHeader()->setSectionsClickable(false); // create layout QVBoxLayout *vbox = new QVBoxLayout(this); diff --git a/src/widgets/settingspages/KeyboardSettingsPage.cpp b/src/widgets/settingspages/KeyboardSettingsPage.cpp index 61c4e668ed7..d63c160299c 100644 --- a/src/widgets/settingspages/KeyboardSettingsPage.cpp +++ b/src/widgets/settingspages/KeyboardSettingsPage.cpp @@ -1,4 +1,4 @@ -#include "KeyboardSettingsPage.hpp" +#include "widgets/settingspages/KeyboardSettingsPage.hpp" #include "Application.hpp" #include "common/QLogging.hpp" @@ -15,6 +15,33 @@ #include #include +namespace { + +using namespace chatterino; + +void tableCellClicked(const QModelIndex &clicked, EditableModelView *view, + HotkeyModel *model) +{ + auto hotkey = getApp()->hotkeys->getHotkeyByName( + clicked.siblingAtColumn(0).data(Qt::EditRole).toString()); + if (!hotkey) + { + return; // clicked on header or invalid hotkey + } + EditHotkeyDialog dialog(hotkey); + bool wasAccepted = dialog.exec() == 1; + + if (wasAccepted) + { + auto newHotkey = dialog.data(); + auto vectorIndex = + getApp()->hotkeys->replaceHotkey(hotkey->name(), newHotkey); + getApp()->hotkeys->save(); + } +} + +} // namespace + namespace chatterino { KeyboardSettingsPage::KeyboardSettingsPage() @@ -22,7 +49,7 @@ KeyboardSettingsPage::KeyboardSettingsPage() LayoutCreator layoutCreator(this); auto layout = layoutCreator.emplace(); - auto model = getApp()->hotkeys->createModel(nullptr); + auto *model = getApp()->hotkeys->createModel(nullptr); EditableModelView *view = layout.emplace(model).getElement(); @@ -35,7 +62,7 @@ KeyboardSettingsPage::KeyboardSettingsPage() 1, QHeaderView::Stretch); // We can safely ignore this signal connection since we own the view - std::ignore = view->addButtonPressed.connect([view, model] { + std::ignore = view->addButtonPressed.connect([] { EditHotkeyDialog dialog(nullptr); bool wasAccepted = dialog.exec() == 1; @@ -48,11 +75,11 @@ KeyboardSettingsPage::KeyboardSettingsPage() }); QObject::connect(view->getTableView(), &QTableView::doubleClicked, - [this, view, model](const QModelIndex &clicked) { - this->tableCellClicked(clicked, view, model); + [view, model](const QModelIndex &clicked) { + tableCellClicked(clicked, view, model); }); - QPushButton *resetEverything = new QPushButton("Reset to defaults"); + auto *resetEverything = new QPushButton("Reset to defaults"); QObject::connect(resetEverything, &QPushButton::clicked, [this]() { auto reply = QMessageBox::question( this, "Reset hotkeys", @@ -67,26 +94,4 @@ KeyboardSettingsPage::KeyboardSettingsPage() view->addCustomButton(resetEverything); } -void KeyboardSettingsPage::tableCellClicked(const QModelIndex &clicked, - EditableModelView *view, - HotkeyModel *model) -{ - auto hotkey = getApp()->hotkeys->getHotkeyByName( - clicked.siblingAtColumn(0).data(Qt::EditRole).toString()); - if (!hotkey) - { - return; // clicked on header or invalid hotkey - } - EditHotkeyDialog dialog(hotkey); - bool wasAccepted = dialog.exec() == 1; - - if (wasAccepted) - { - auto newHotkey = dialog.data(); - auto vectorIndex = - getApp()->hotkeys->replaceHotkey(hotkey->name(), newHotkey); - getApp()->hotkeys->save(); - } -} - } // namespace chatterino diff --git a/src/widgets/settingspages/KeyboardSettingsPage.hpp b/src/widgets/settingspages/KeyboardSettingsPage.hpp index 2a7d1dff99e..fcd9eed613b 100644 --- a/src/widgets/settingspages/KeyboardSettingsPage.hpp +++ b/src/widgets/settingspages/KeyboardSettingsPage.hpp @@ -11,10 +11,6 @@ class KeyboardSettingsPage : public SettingsPage { public: KeyboardSettingsPage(); - -private: - void tableCellClicked(const QModelIndex &clicked, EditableModelView *view, - HotkeyModel *model); }; } // namespace chatterino From 7a29255039a89bbcb8f14de2e1e89435178fbd6b Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 5 Nov 2023 00:51:06 +0100 Subject: [PATCH 52/91] Fix paths for real this time. --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 249a25de7ff..c70f44941dd 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -180,7 +180,7 @@ jobs: run: | cd ../httpbin cargo run & - cd ../../build-test + cd ../build-test ./pubsub-server-test/server.exe 127.0.0.1:9050 & ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe working-directory: build-test From 25ba2ed90d3c05fbf55dd6a7ac225c94857162a3 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 5 Nov 2023 16:47:59 +0100 Subject: [PATCH 53/91] Move to `go-httpbin` because `httpbin-rs` doesn't support the `/status/{code}` endpoints --- .github/workflows/test-windows.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index c70f44941dd..caf566e1991 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -179,7 +179,10 @@ jobs: timeout-minutes: 30 run: | cd ../httpbin - cargo run & + Invoke-WebRequest -Uri "https://gist.github.com/Wissididom/2eff110a9bf5c7bd995f05b42dd63c22/raw/5c11ca381e338d880d0fdf6ec4b6035df2ebf707/httpbin.go" - outfile "httpbin.go" + go mod init main + go mod tidy + go run httpbin.go & cd ../build-test ./pubsub-server-test/server.exe 127.0.0.1:9050 & ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe From f81bfdefafc6c16c85e1954e9aae919ea0d4d86b Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 5 Nov 2023 17:04:01 +0100 Subject: [PATCH 54/91] Remove `httpbin-rs` checkout step --- .github/workflows/test-windows.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index caf566e1991..4715080e907 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -167,13 +167,6 @@ jobs: rm pubsub-server.zip shell: pwsh - - name: Checkout httpbin - if: startsWith(matrix.os, 'windows') - uses: actions/checkout@v4 - with: - repository: "duskmoon314/httpbin-rs" - path: "httpbin" - - name: Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 From 47065759ce045820353f7d55dd5ec87ef9397b40 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 5 Nov 2023 17:32:42 +0100 Subject: [PATCH 55/91] Remove httpbin directory --- .github/workflows/test-windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 4715080e907..5c267a94ef7 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -171,12 +171,10 @@ jobs: if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - cd ../httpbin Invoke-WebRequest -Uri "https://gist.github.com/Wissididom/2eff110a9bf5c7bd995f05b42dd63c22/raw/5c11ca381e338d880d0fdf6ec4b6035df2ebf707/httpbin.go" - outfile "httpbin.go" go mod init main go mod tidy go run httpbin.go & - cd ../build-test ./pubsub-server-test/server.exe 127.0.0.1:9050 & ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe working-directory: build-test From 0a9616e79c31f48f76d7e0abd908eda9bca1b6df Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 5 Nov 2023 17:52:57 +0100 Subject: [PATCH 56/91] Fix Invoke-WebRequest typo --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 5c267a94ef7..6e565856eaf 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -171,7 +171,7 @@ jobs: if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - Invoke-WebRequest -Uri "https://gist.github.com/Wissididom/2eff110a9bf5c7bd995f05b42dd63c22/raw/5c11ca381e338d880d0fdf6ec4b6035df2ebf707/httpbin.go" - outfile "httpbin.go" + Invoke-WebRequest -Uri "https://gist.github.com/Wissididom/2eff110a9bf5c7bd995f05b42dd63c22/raw/5c11ca381e338d880d0fdf6ec4b6035df2ebf707/httpbin.go" -outfile "httpbin.go" go mod init main go mod tidy go run httpbin.go & From fe93163ce752b01b392e5607ad3712f094bbc995 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:11:20 +0100 Subject: [PATCH 57/91] Move to httpbox --- .github/workflows/test-windows.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 6e565856eaf..551ddc65528 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -167,16 +167,23 @@ jobs: rm pubsub-server.zip shell: pwsh + - name: Checkout httpbox + if: startsWith(matrix.os, 'windows') + uses: actions/checkout@v4 + with: + repository: "kevinastone/httpbox" + path: "httpbox" + - name: Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - Invoke-WebRequest -Uri "https://gist.github.com/Wissididom/2eff110a9bf5c7bd995f05b42dd63c22/raw/5c11ca381e338d880d0fdf6ec4b6035df2ebf707/httpbin.go" -outfile "httpbin.go" - go mod init main - go mod tidy - go run httpbin.go & - ./pubsub-server-test/server.exe 127.0.0.1:9050 & - ./bin/chatterino-test.exe || ./bin/chatterino-test.exe || ./bin/chatterino-test.exe + cd ..\httpbox + cargo build + cargo run -- --port 9051 & + cd ..\build-test + .\pubsub-server-test\server.exe 127.0.0.1:9050 & + .\bin\chatterino-test.exe || .\bin\chatterino-test.exe || .\bin\chatterino-test.exe working-directory: build-test shell: pwsh From 02cb4736d9f991d4293f639433fb4845347a8318 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 6 Nov 2023 21:23:22 +0100 Subject: [PATCH 58/91] Download crt and key because the pubsub-server seems to require it --- .github/workflows/test-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 551ddc65528..52662497937 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -182,6 +182,8 @@ jobs: cargo build cargo run -- --port 9051 & cd ..\build-test + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.crt" -outfile "pubsub-server-test\server.crt" + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "pubsub-server-test\server.key" .\pubsub-server-test\server.exe 127.0.0.1:9050 & .\bin\chatterino-test.exe || .\bin\chatterino-test.exe || .\bin\chatterino-test.exe working-directory: build-test From 314fb102406e21ab93d86a6cf088c20115014692 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 6 Nov 2023 21:25:39 +0100 Subject: [PATCH 59/91] Change directory instead of running the pubsub-server from the parent directory --- .github/workflows/test-windows.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 52662497937..20f0af4a0c8 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -182,9 +182,11 @@ jobs: cargo build cargo run -- --port 9051 & cd ..\build-test - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.crt" -outfile "pubsub-server-test\server.crt" - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "pubsub-server-test\server.key" - .\pubsub-server-test\server.exe 127.0.0.1:9050 & + cd pubsub-server-test + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.crt" -outfile "server.crt" + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" + .\server.exe 127.0.0.1:9050 & + cd .. .\bin\chatterino-test.exe || .\bin\chatterino-test.exe || .\bin\chatterino-test.exe working-directory: build-test shell: pwsh From 27ad8f58f68933cae43767bbbfd787a51c6ded7d Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 6 Nov 2023 21:46:09 +0100 Subject: [PATCH 60/91] Fix paths --- .github/workflows/test-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 20f0af4a0c8..8fb8fa43e2a 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -182,11 +182,11 @@ jobs: cargo build cargo run -- --port 9051 & cd ..\build-test - cd pubsub-server-test + cd ..\pubsub-server-test Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.crt" -outfile "server.crt" Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & - cd .. + cd ..\build-test .\bin\chatterino-test.exe || .\bin\chatterino-test.exe || .\bin\chatterino-test.exe working-directory: build-test shell: pwsh From b75e1a7885324cb81e814dec93a755469e03597a Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 6 Nov 2023 22:40:46 +0100 Subject: [PATCH 61/91] Try specifying C++20 in CMakeLists --- tests/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 08cb44acf9f..c5f8bea03c4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,6 +2,9 @@ project(chatterino-test) option(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN "Use public httpbin for testing network requests" OFF) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(test_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/main.cpp ${CMAKE_CURRENT_LIST_DIR}/resources/test-resources.qrc From c0d399fbab5114fb87c83020933fb387c0f32c22 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:37:09 +0100 Subject: [PATCH 62/91] Remove unneccessary env variable from test-windows.yml --- .github/workflows/test-windows.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 8fb8fa43e2a..45e7d59637f 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -7,7 +7,6 @@ on: merge_group: env: - TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.6 QT_QPA_PLATFORM: minimal # Last known good conan version # 2.0.3 has a bug on Windows (conan-io/conan#13606) @@ -29,7 +28,6 @@ jobs: plugins: [false] skip-artifact: [false] skip-crashpad: [false] - clang-tidy-review: [false] fail-fast: false env: C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} @@ -54,12 +52,6 @@ jobs: echo "C2_ENABLE_CRASHPAD=ON" >> "$Env:GITHUB_ENV" shell: pwsh - - name: Set environment variables for windows-latest - if: matrix.os == 'windows-latest' - run: | - echo "vs_version=2022" >> "$Env:GITHUB_ENV" - shell: pwsh - - name: Set BUILD_WITH_QT6 if: startsWith(matrix.qt-version, '6.') run: | From cf9bb5c32ca3355054c6b85f6b73a0264e01f611 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:21:25 +0100 Subject: [PATCH 63/91] Test specifying 2 instead of 1 to make ubuntu fail --- tests/src/InputCompletion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/InputCompletion.cpp b/tests/src/InputCompletion.cpp index 623d3a79934..1d62cdf3adb 100644 --- a/tests/src/InputCompletion.cpp +++ b/tests/src/InputCompletion.cpp @@ -104,8 +104,8 @@ class InputCompletionTest : public ::testing::Test // Initialize helix client this->mockHelix = std::make_unique(); initializeHelix(this->mockHelix.get()); - EXPECT_CALL(*this->mockHelix, loadBlocks).Times(Exactly(1)); - EXPECT_CALL(*this->mockHelix, update).Times(Exactly(1)); + EXPECT_CALL(*this->mockHelix, loadBlocks).Times(Exactly(2)); + EXPECT_CALL(*this->mockHelix, update).Times(Exactly(2)); this->mockApplication = std::make_unique(); this->settings = std::make_unique(this->settingsDir_->path()); From 51c8b72465e0d3166c980602a356f841723a9784 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:37:24 +0100 Subject: [PATCH 64/91] Make ubuntu test output verbose --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9e490390b2..b45ca108c52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -99,6 +99,6 @@ jobs: 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 - ctest --repeat until-pass:4 + ctest --repeat until-pass:4 --output-on-failure working-directory: build-test shell: bash From ce4a7b91b5b7d1fb508d4c9f9b00571aed27d9d5 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sun, 12 Nov 2023 13:59:38 +0100 Subject: [PATCH 65/91] Revert changing EXPECT_CALL from 1 to 2 --- tests/src/InputCompletion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/InputCompletion.cpp b/tests/src/InputCompletion.cpp index 1d62cdf3adb..623d3a79934 100644 --- a/tests/src/InputCompletion.cpp +++ b/tests/src/InputCompletion.cpp @@ -104,8 +104,8 @@ class InputCompletionTest : public ::testing::Test // Initialize helix client this->mockHelix = std::make_unique(); initializeHelix(this->mockHelix.get()); - EXPECT_CALL(*this->mockHelix, loadBlocks).Times(Exactly(2)); - EXPECT_CALL(*this->mockHelix, update).Times(Exactly(2)); + EXPECT_CALL(*this->mockHelix, loadBlocks).Times(Exactly(1)); + EXPECT_CALL(*this->mockHelix, update).Times(Exactly(1)); this->mockApplication = std::make_unique(); this->settings = std::make_unique(this->settingsDir_->path()); From e0affb5c2c6ea6a3e66db7b722a357154f1a5180 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 08:40:30 +0100 Subject: [PATCH 66/91] Try using ctest on Mac --- .github/workflows/test-macos.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 6d8be584d01..b941bd13d2c 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -99,7 +99,8 @@ jobs: 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 - ./bin/chatterino-test || ./bin/chatterino-test || ./bin/chatterino-test + # ./bin/chatterino-test || ./bin/chatterino-test || ./bin/chatterino-test + ctest --repeat until-pass:4 --output-on-failure working-directory: build-test shell: bash From 09ae668e2b28dbc72ce4380672ca5a60492c61cc Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:07:45 +0100 Subject: [PATCH 67/91] Try using ctest on Windows --- .github/workflows/test-windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 45e7d59637f..96c4b8cfb7b 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -179,7 +179,8 @@ jobs: Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & cd ..\build-test - .\bin\chatterino-test.exe || .\bin\chatterino-test.exe || .\bin\chatterino-test.exe + # .\bin\chatterino-test.exe || .\bin\chatterino-test.exe || .\bin\chatterino-test.exe + ctest --repeat until-pass:4 --output-on-failure working-directory: build-test shell: pwsh From a4b9dc59d6be9a1ecfe9907a01a17ea68e19c40c Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:31:54 +0100 Subject: [PATCH 68/91] Remove old test line because ctest seems to work on all platforms --- .github/workflows/test-macos.yml | 1 - .github/workflows/test-windows.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index b941bd13d2c..12c30f1d7b4 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -99,7 +99,6 @@ jobs: 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 - # ./bin/chatterino-test || ./bin/chatterino-test || ./bin/chatterino-test ctest --repeat until-pass:4 --output-on-failure working-directory: build-test shell: bash diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 96c4b8cfb7b..856e16bb1cc 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -179,7 +179,6 @@ jobs: Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & cd ..\build-test - # .\bin\chatterino-test.exe || .\bin\chatterino-test.exe || .\bin\chatterino-test.exe ctest --repeat until-pass:4 --output-on-failure working-directory: build-test shell: pwsh From ddfbc7e5cadcb2e7fcfe7eabb64c533aaa137a24 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 10:50:57 +0100 Subject: [PATCH 69/91] Make MacOS Workflow Verbose --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 12c30f1d7b4..b2fbe0aa3a2 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -99,7 +99,7 @@ jobs: 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 - ctest --repeat until-pass:4 --output-on-failure + ctest --repeat until-pass:4 --output-on-failure --verbose working-directory: build-test shell: bash From b15c09d01e191bbce97429b8ca2cc80ccfcb842d Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 11:21:32 +0100 Subject: [PATCH 70/91] Revert making MacOS Workflow Verbose because the Subprocess abort didn't happen now, so it seems like it's an error that only sometimes happens. --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index b2fbe0aa3a2..12c30f1d7b4 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -99,7 +99,7 @@ jobs: 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 - ctest --repeat until-pass:4 --output-on-failure --verbose + ctest --repeat until-pass:4 --output-on-failure working-directory: build-test shell: bash From bee0d7878c193082fcedfc0bfbc65d5addc810d2 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:10:20 +0100 Subject: [PATCH 71/91] Revert editing the tests/CMakeLists.txt --- tests/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c5f8bea03c4..08cb44acf9f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,9 +2,6 @@ project(chatterino-test) option(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN "Use public httpbin for testing network requests" OFF) -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(test_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/main.cpp ${CMAKE_CURRENT_LIST_DIR}/resources/test-resources.qrc From 1709f1ab056ba690b92bda4c745715e493993689 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:59:40 +0100 Subject: [PATCH 72/91] Add exclude-test option to ctest --- .github/workflows/test-macos.yml | 2 +- .github/workflows/test-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 12c30f1d7b4..ceced736b7c 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -99,7 +99,7 @@ jobs: 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 - ctest --repeat until-pass:4 --output-on-failure + ctest --repeat until-pass:4 --output-on-failure --exclude-test InputCompletionTest.ClassicEmoteNameFiltering working-directory: build-test shell: bash diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 856e16bb1cc..ef2020f1b74 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -179,7 +179,7 @@ jobs: Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & cd ..\build-test - ctest --repeat until-pass:4 --output-on-failure + ctest --repeat until-pass:4 --output-on-failure --exclude-test InputCompletionTest.ClassicEmoteNameFiltering working-directory: build-test shell: pwsh From 408a6e8c69e4c349fcbe450c1dbc7cfb1cfac743 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:34:20 +0100 Subject: [PATCH 73/91] Change exclude-test to label-exclude --- .github/workflows/test-macos.yml | 2 +- .github/workflows/test-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index ceced736b7c..4bf536d4f02 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -99,7 +99,7 @@ jobs: 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 - ctest --repeat until-pass:4 --output-on-failure --exclude-test InputCompletionTest.ClassicEmoteNameFiltering + ctest --repeat until-pass:4 --output-on-failure --label-exclude InputCompletionTest.ClassicEmoteNameFiltering working-directory: build-test shell: bash diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index ef2020f1b74..bbf1f2bad71 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -179,7 +179,7 @@ jobs: Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & cd ..\build-test - ctest --repeat until-pass:4 --output-on-failure --exclude-test InputCompletionTest.ClassicEmoteNameFiltering + ctest --repeat until-pass:4 --output-on-failure --label-exclude InputCompletionTest.ClassicEmoteNameFiltering working-directory: build-test shell: pwsh From 7884ba63421fedc757b8777a6132679501afc33c Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:40:23 +0100 Subject: [PATCH 74/91] Change to exclude-regex --- .github/workflows/test-macos.yml | 2 +- .github/workflows/test-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 4bf536d4f02..e85aad3289f 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -99,7 +99,7 @@ jobs: 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 - ctest --repeat until-pass:4 --output-on-failure --label-exclude InputCompletionTest.ClassicEmoteNameFiltering + ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering working-directory: build-test shell: bash diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index bbf1f2bad71..409b209f688 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -179,7 +179,7 @@ jobs: Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & cd ..\build-test - ctest --repeat until-pass:4 --output-on-failure --label-exclude InputCompletionTest.ClassicEmoteNameFiltering + ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering working-directory: build-test shell: pwsh From 9feff879bc6662e200445a8b29fe2576b1866fb6 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 20:53:54 +0100 Subject: [PATCH 75/91] Extract pubsub server version to env variable --- .github/workflows/test-windows.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 409b209f688..018586a1208 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -7,6 +7,7 @@ on: merge_group: env: + TWITCH_PUBSUB_SERVER_TAG: v1.0.7 QT_QPA_PLATFORM: minimal # Last known good conan version # 2.0.3 has a bug on Windows (conan-io/conan#13606) @@ -154,7 +155,7 @@ jobs: if: startsWith(matrix.os, 'windows') run: | mkdir pubsub-server-test - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/v1.0.7/server-v1.0.7-windows-amd64.zip" -outfile "pubsub-server.zip" + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/server-v1.0.7-windows-amd64.zip" -outfile "pubsub-server.zip" Expand-Archive pubsub-server.zip -DestinationPath pubsub-server-test rm pubsub-server.zip shell: pwsh @@ -175,8 +176,8 @@ jobs: cargo run -- --port 9051 & cd ..\build-test cd ..\pubsub-server-test - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.crt" -outfile "server.crt" - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/master/cmd/server/server.key" -outfile "server.key" + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt" -outfile "server.crt" + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & cd ..\build-test ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering From a186590ddb933c3860fd5b84b2024a12956fd264 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 21:20:39 +0100 Subject: [PATCH 76/91] Get version in filename from env var --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 018586a1208..7ff019d2d35 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -155,7 +155,7 @@ jobs: if: startsWith(matrix.os, 'windows') run: | mkdir pubsub-server-test - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/server-v1.0.7-windows-amd64.zip" -outfile "pubsub-server.zip" + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/server-${{ env.TWITCH_PUBSUB_SERVER_TAG }}-windows-amd64.zip" -outfile "pubsub-server.zip" Expand-Archive pubsub-server.zip -DestinationPath pubsub-server-test rm pubsub-server.zip shell: pwsh From d9add37d29a04788209ee775d9c3a46a8aca782f Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 21:51:25 +0100 Subject: [PATCH 77/91] Change Qt to 6.5.0 on Windows --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 7ff019d2d35..68746e6037b 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: os: [windows-latest] - qt-version: [5.15.2, 6.2.4] + qt-version: [5.15.2, 6.5.0] force-lto: [false] plugins: [false] skip-artifact: [false] From 8488115c9e1913c096caedc6d7cc2c9e3021f3b4 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 22:00:52 +0100 Subject: [PATCH 78/91] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d9f7defe19..e99063a6d86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ - Dev: Refactor `IrcMessageHandler`, removing a bunch of clang-tidy warnings & changing its public API. (#4927) - Dev: `Details` file properties tab is now populated on Windows. (#4912) - Dev: Removed `Outcome` from network requests. (#4959) +- Dev: Added Tests for Windows and MacOS in CI. (#4970) ## 2.4.6 From 3c3a8fd87bab25bfe39802af197b33dc52f56f09 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Fri, 17 Nov 2023 22:54:03 +0100 Subject: [PATCH 79/91] Put httpbox to another step and use cargo to checkout and install --- .github/workflows/test-windows.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 68746e6037b..dd99db7af84 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -160,21 +160,16 @@ jobs: rm pubsub-server.zip shell: pwsh - - name: Checkout httpbox + - name: Checkout, install and run httpbox if: startsWith(matrix.os, 'windows') - uses: actions/checkout@v4 - with: - repository: "kevinastone/httpbox" - path: "httpbox" + run: | + cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f + httpbox --port 9051 & - name: Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - cd ..\httpbox - cargo build - cargo run -- --port 9051 & - cd ..\build-test cd ..\pubsub-server-test Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt" -outfile "server.crt" Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key" -outfile "server.key" From 5ebef036fc7df67aa5c0dc2005e80c4655e99a0d Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 00:31:36 +0100 Subject: [PATCH 80/91] Run httpbox in foreground temporarily to see why the network requests fail Will probably time out or being cancelled --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index dd99db7af84..05eddf2f5a4 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -164,7 +164,7 @@ jobs: if: startsWith(matrix.os, 'windows') run: | cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f - httpbox --port 9051 & + httpbox --port 9051 - name: Test if: startsWith(matrix.os, 'windows') From 26cb51b4e05de0fd6e03790a8c3ef4ffb3c8d310 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 00:54:04 +0100 Subject: [PATCH 81/91] Make httpbox run in background again because it seems to work as expected --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 05eddf2f5a4..dd99db7af84 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -164,7 +164,7 @@ jobs: if: startsWith(matrix.os, 'windows') run: | cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f - httpbox --port 9051 + httpbox --port 9051 & - name: Test if: startsWith(matrix.os, 'windows') From e4ccc1ff4fdc1071fd2e1ab299e311729a76752c Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 01:15:08 +0100 Subject: [PATCH 82/91] Try moving httpbox back to the Test step to see if background jobs get killed between steps --- .github/workflows/test-windows.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index dd99db7af84..6b47d2f47b4 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -160,16 +160,12 @@ jobs: rm pubsub-server.zip shell: pwsh - - name: Checkout, install and run httpbox - if: startsWith(matrix.os, 'windows') - run: | - cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f - httpbox --port 9051 & - - name: Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | + cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f + httpbox --port 9051 & cd ..\pubsub-server-test Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt" -outfile "server.crt" Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key" -outfile "server.key" From 165e88273fc7fe1bc7a97cb5a2ac301fd79dfcbc Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 10:25:21 +0100 Subject: [PATCH 83/91] Make cargo install a separate step and move crt and key download to the pubsub download step --- .github/workflows/test-windows.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 6b47d2f47b4..2df0a38d337 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -158,17 +158,24 @@ jobs: Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/server-${{ env.TWITCH_PUBSUB_SERVER_TAG }}-windows-amd64.zip" -outfile "pubsub-server.zip" Expand-Archive pubsub-server.zip -DestinationPath pubsub-server-test rm pubsub-server.zip + cd pubsub-server-test + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt" -outfile "server.crt" + Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key" -outfile "server.key" + cd .. + shell: pwsh + + - name: Cargo Install httpbox + if: startsWith(matrix.os, 'windows') + run: | + cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f shell: pwsh - name: Test if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | - cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f httpbox --port 9051 & cd ..\pubsub-server-test - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt" -outfile "server.crt" - Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key" -outfile "server.key" .\server.exe 127.0.0.1:9050 & cd ..\build-test ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering From 146e9de89755d9a547f7edf38f97d1b83b1967ed Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:34:33 +0100 Subject: [PATCH 84/91] Change MacOS Qt to 6.5.0 --- .github/workflows/test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index e85aad3289f..52824eda427 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: os: [macos-13] - qt-version: [5.15.2, 6.2.4] + qt-version: [5.15.2, 6.5.0] force-lto: [false] plugins: [false] clang-tidy-review: [false] From 6ef344b6b6ccb060658a365422072050b6553b35 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:44:21 +0100 Subject: [PATCH 85/91] Remove clang-tidy-review and if macos conditions --- .github/workflows/test-macos.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 52824eda427..17b835395e9 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -24,7 +24,6 @@ jobs: qt-version: [5.15.2, 6.5.0] force-lto: [false] plugins: [false] - clang-tidy-review: [false] fail-fast: false env: C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }} @@ -63,19 +62,16 @@ jobs: version: ${{ matrix.qt-version }} - name: Install dependencies - if: startsWith(matrix.os, 'macos') run: | brew install boost openssl rapidjson p7zip create-dmg cmake tree docker colima shell: bash - name: Setup Colima - if: startsWith(matrix.os, 'macos') run: | colima start shell: bash - name: Build - if: startsWith(matrix.os, 'macos') shell: bash run: | mkdir build-test @@ -92,7 +88,6 @@ jobs: make -j"$(sysctl -n hw.logicalcpu)" - name: Test - if: startsWith(matrix.os, 'macos') timeout-minutes: 30 run: | docker pull kennethreitz/httpbin @@ -104,7 +99,7 @@ jobs: shell: bash - name: Post Setup Colima - if: startsWith(matrix.os, 'macos') && always() + if: always() run: | colima stop working-directory: build-test From effe3fdc9ad695d87c42c34f860b990ee43da974 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:45:55 +0100 Subject: [PATCH 86/91] Remove `shell: bash`'s --- .github/workflows/test-macos.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 17b835395e9..ee06f27eba2 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -34,19 +34,16 @@ jobs: if: matrix.force-lto run: | echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV" - shell: bash - name: Enable plugin support if: matrix.plugins run: | echo "C2_PLUGINS=ON" >> "$GITHUB_ENV" - shell: bash - name: Set BUILD_WITH_QT6 if: startsWith(matrix.qt-version, '6.') run: | echo "C2_BUILD_WITH_QT6=ON" >> "$GITHUB_ENV" - shell: bash - uses: actions/checkout@v4 with: @@ -64,15 +61,12 @@ jobs: - name: Install dependencies run: | brew install boost openssl rapidjson p7zip create-dmg cmake tree docker colima - shell: bash - name: Setup Colima run: | colima start - shell: bash - name: Build - shell: bash run: | mkdir build-test cd build-test @@ -96,11 +90,9 @@ jobs: docker run -p 9051:80 --detach kennethreitz/httpbin ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering working-directory: build-test - shell: bash - name: Post Setup Colima if: always() run: | colima stop working-directory: build-test - shell: bash From 65c7988ff11428ac891c7a63aa033c2b7d48ca66 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:47:42 +0100 Subject: [PATCH 87/91] Remove LTO stuff --- .github/workflows/test-macos.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index ee06f27eba2..4d9b8c55af5 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -22,7 +22,6 @@ jobs: matrix: os: [macos-13] qt-version: [5.15.2, 6.5.0] - force-lto: [false] plugins: [false] fail-fast: false env: @@ -30,11 +29,6 @@ jobs: QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }} steps: - - name: Force LTO - if: matrix.force-lto - run: | - echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV" - - name: Enable plugin support if: matrix.plugins run: | @@ -75,7 +69,6 @@ jobs: -DBUILD_TESTS=On \ -DBUILD_APP=OFF \ -DUSE_PRECOMPILED_HEADERS=OFF \ - -DCHATTERINO_LTO="$C2_ENABLE_LTO" \ -DCHATTERINO_PLUGINS="$C2_PLUGINS" \ -DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \ .. From 0795f732075bc37b93e04700fdba29ffe4b8ee73 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:48:41 +0100 Subject: [PATCH 88/91] Remove LTO stuff from Windows --- .github/workflows/test-windows.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 2df0a38d337..692b0e4ebbf 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -25,7 +25,6 @@ jobs: matrix: os: [windows-latest] qt-version: [5.15.2, 6.5.0] - force-lto: [false] plugins: [false] skip-artifact: [false] skip-crashpad: [false] @@ -35,12 +34,6 @@ jobs: QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }} steps: - - name: Force LTO - if: matrix.force-lto - run: | - echo "C2_ENABLE_LTO=ON" >> "$Env:GITHUB_ENV" - shell: pwsh - - name: Enable plugin support if: matrix.plugins run: | @@ -143,7 +136,6 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" ` -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} ` -DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" ` - -DCHATTERINO_LTO="$Env:C2_ENABLE_LTO" ` -DCHATTERINO_PLUGINS="$Env:C2_PLUGINS" ` -DBUILD_WITH_QT6="$Env:C2_BUILD_WITH_QT6" ` .. From 596acd94f6b94a7ffa0e12ca2e2184ba77fd85e1 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:50:00 +0100 Subject: [PATCH 89/91] Remove if windows checks --- .github/workflows/test-windows.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 692b0e4ebbf..91bbbca72fe 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -66,7 +66,6 @@ jobs: version: ${{ matrix.qt-version }} - name: Enable Developer Command Prompt - if: startsWith(matrix.os, 'windows') uses: ilammy/msvc-dev-cmd@v1.12.1 - name: Setup conan variables @@ -79,7 +78,6 @@ jobs: - name: Setup sccache # sccache v0.5.3 uses: nerixyz/ccache-action@9a7e8d00116ede600ee7717350c6594b8af6aaa5 - if: startsWith(matrix.os, 'windows') with: variant: sccache # only save on the default (master) branch @@ -89,27 +87,23 @@ jobs: sccache-test-${{ matrix.os }}-${{ matrix.qt-version }} - name: Cache conan packages - if: startsWith(matrix.os, 'windows') uses: actions/cache@v3 with: key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.py') }}${{ env.C2_CONAN_CACHE_SUFFIX }} path: ~/.conan2/ - name: Install Conan - if: startsWith(matrix.os, 'windows') run: | python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$Env:GITHUB_PATH" pip3 install --user "conan==${{ env.CONAN_VERSION }}" shell: pwsh - name: Setup Conan - if: startsWith(matrix.os, 'windows') run: | conan --version conan profile detect -f - name: Install dependencies - if: startsWith(matrix.os, 'windows') run: | mkdir build-test cd build-test @@ -122,7 +116,6 @@ jobs: shell: powershell - name: Build - if: startsWith(matrix.os, 'windows') shell: pwsh env: # Enable PCH on Windows, later we can have it depend on the run/Qt Version like in the build workflow, I just want to make it work @@ -144,7 +137,6 @@ jobs: working-directory: build-test - name: Download and extract Twitch PubSub Server Test - if: startsWith(matrix.os, 'windows') run: | mkdir pubsub-server-test Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/server-${{ env.TWITCH_PUBSUB_SERVER_TAG }}-windows-amd64.zip" -outfile "pubsub-server.zip" @@ -157,13 +149,11 @@ jobs: shell: pwsh - name: Cargo Install httpbox - if: startsWith(matrix.os, 'windows') run: | cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f shell: pwsh - name: Test - if: startsWith(matrix.os, 'windows') timeout-minutes: 30 run: | httpbox --port 9051 & @@ -175,6 +165,5 @@ jobs: shell: pwsh - name: Clean Conan cache - if: startsWith(matrix.os, 'windows') run: conan cache clean --source --build --download "*" shell: pwsh From fbe87c01c6946b0ddb112592ef8a37a288047667 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:53:01 +0100 Subject: [PATCH 90/91] Remove powershell because it's the default according to https://github.blog/changelog/2019-10-17-github-actions-default-shell-on-windows-runners-is-changing-to-powershell/ --- .github/workflows/test-windows.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 91bbbca72fe..6e3b2df44cd 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -38,19 +38,16 @@ jobs: if: matrix.plugins run: | echo "C2_PLUGINS=ON" >> "$Env:GITHUB_ENV" - shell: pwsh - name: Set Crashpad if: matrix.skip-crashpad == false run: | echo "C2_ENABLE_CRASHPAD=ON" >> "$Env:GITHUB_ENV" - shell: pwsh - name: Set BUILD_WITH_QT6 if: startsWith(matrix.qt-version, '6.') run: | echo "C2_BUILD_WITH_QT6=ON" >> "$Env:GITHUB_ENV" - shell: pwsh - uses: actions/checkout@v4 with: @@ -73,7 +70,6 @@ jobs: run: | "C2_USE_OPENSSL3=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "True" } else { "False" })" >> "$Env:GITHUB_ENV" "C2_CONAN_CACHE_SUFFIX=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "-QT6" } else { "`" })" >> "$Env:GITHUB_ENV" - shell: powershell - name: Setup sccache # sccache v0.5.3 @@ -96,7 +92,6 @@ jobs: run: | python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$Env:GITHUB_PATH" pip3 install --user "conan==${{ env.CONAN_VERSION }}" - shell: pwsh - name: Setup Conan run: | @@ -113,10 +108,8 @@ jobs: -b missing ` --output-folder=. ` -o with_openssl3="$Env:C2_USE_OPENSSL3" - shell: powershell - name: Build - shell: pwsh env: # Enable PCH on Windows, later we can have it depend on the run/Qt Version like in the build workflow, I just want to make it work C2_WINDOWS_USE_PCH: True @@ -146,12 +139,10 @@ jobs: Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt" -outfile "server.crt" Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key" -outfile "server.key" cd .. - shell: pwsh - name: Cargo Install httpbox run: | cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f - shell: pwsh - name: Test timeout-minutes: 30 @@ -162,8 +153,6 @@ jobs: cd ..\build-test ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering working-directory: build-test - shell: pwsh - name: Clean Conan cache run: conan cache clean --source --build --download "*" - shell: pwsh From 298731b208450251927b29bfadd397e0a44b471c Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:28:56 +0100 Subject: [PATCH 91/91] Remove PCH env variable from test-windows.yml --- .github/workflows/test-windows.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 6e3b2df44cd..bb543ff2371 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -110,9 +110,6 @@ jobs: -o with_openssl3="$Env:C2_USE_OPENSSL3" - name: Build - env: - # Enable PCH on Windows, later we can have it depend on the run/Qt Version like in the build workflow, I just want to make it work - C2_WINDOWS_USE_PCH: True run: | cmake ` -G"NMake Makefiles" ` @@ -120,7 +117,7 @@ jobs: -DBUILD_TESTS=On ` -DBUILD_APP=OFF ` -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" ` - -DUSE_PRECOMPILED_HEADERS=${{ env.C2_WINDOWS_USE_PCH }} ` + -DUSE_PRECOMPILED_HEADERS=On ` -DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" ` -DCHATTERINO_PLUGINS="$Env:C2_PLUGINS" ` -DBUILD_WITH_QT6="$Env:C2_BUILD_WITH_QT6" `