2023-11-18 15:13:27 +01:00
|
|
|
---
|
|
|
|
name: Test Windows
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
merge_group:
|
|
|
|
|
|
|
|
env:
|
|
|
|
TWITCH_PUBSUB_SERVER_TAG: v1.0.7
|
2024-10-18 21:23:13 +02:00
|
|
|
HTTPBOX_TAG: v0.2.1
|
2023-11-18 15:13:27 +01:00
|
|
|
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-windows-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-windows:
|
|
|
|
name: "Test ${{ matrix.os }}, Qt ${{ matrix.qt-version }}"
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest]
|
2024-05-25 18:26:38 +02:00
|
|
|
qt-version: [5.15.2, 6.7.1]
|
2024-10-20 11:57:05 +02:00
|
|
|
plugins: [true]
|
2023-11-18 15:13:27 +01:00
|
|
|
skip-artifact: [false]
|
|
|
|
skip-crashpad: [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' || '' }}
|
2024-04-21 18:30:31 +02:00
|
|
|
C2_USE_OPENSSL3: ${{ startsWith(matrix.qt-version, '6.') && 'True' || 'False' }}
|
|
|
|
C2_CONAN_CACHE_SUFFIX: ${{ startsWith(matrix.qt-version, '6.') && '-QT6' || '' }}
|
2023-11-18 15:13:27 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Enable plugin support
|
|
|
|
if: matrix.plugins
|
|
|
|
run: |
|
|
|
|
echo "C2_PLUGINS=ON" >> "$Env:GITHUB_ENV"
|
|
|
|
|
|
|
|
- name: Set Crashpad
|
|
|
|
if: matrix.skip-crashpad == false
|
|
|
|
run: |
|
|
|
|
echo "C2_ENABLE_CRASHPAD=ON" >> "$Env:GITHUB_ENV"
|
|
|
|
|
|
|
|
- name: Set BUILD_WITH_QT6
|
|
|
|
if: startsWith(matrix.qt-version, '6.')
|
|
|
|
run: |
|
|
|
|
echo "C2_BUILD_WITH_QT6=ON" >> "$Env:GITHUB_ENV"
|
|
|
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
fetch-depth: 0 # allows for tags access
|
|
|
|
|
|
|
|
- name: Install Qt
|
2024-11-17 13:05:55 +01:00
|
|
|
uses: jurplel/install-qt-action@v4.1.1
|
2023-11-18 15:13:27 +01:00
|
|
|
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
|
2024-01-02 15:01:47 +01:00
|
|
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
2023-11-18 15:13:27 +01:00
|
|
|
|
|
|
|
- name: Setup sccache
|
2024-03-04 04:32:52 +01:00
|
|
|
# sccache v0.7.4
|
2024-08-09 11:29:09 +02:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2.14
|
2023-11-18 15:13:27 +01:00
|
|
|
with:
|
|
|
|
variant: sccache
|
|
|
|
# only save on the default (master) branch
|
|
|
|
save: ${{ github.event_name == 'push' }}
|
|
|
|
key: sccache-test-${{ matrix.os }}-${{ matrix.qt-version }}-${{ matrix.skip-crashpad }}
|
|
|
|
restore-keys: |
|
|
|
|
sccache-test-${{ matrix.os }}-${{ matrix.qt-version }}
|
|
|
|
|
|
|
|
- name: Cache conan packages
|
2024-01-18 01:54:17 +01:00
|
|
|
uses: actions/cache@v4
|
2023-11-18 15:13:27 +01:00
|
|
|
with:
|
|
|
|
key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.py') }}${{ env.C2_CONAN_CACHE_SUFFIX }}
|
|
|
|
path: ~/.conan2/
|
|
|
|
|
|
|
|
- name: Install Conan
|
|
|
|
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 }}"
|
|
|
|
|
|
|
|
- name: Setup Conan
|
|
|
|
run: |
|
|
|
|
conan --version
|
|
|
|
conan profile detect -f
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
mkdir build-test
|
|
|
|
cd build-test
|
|
|
|
conan install .. `
|
|
|
|
-s build_type=RelWithDebInfo `
|
|
|
|
-c tools.cmake.cmaketoolchain:generator="NMake Makefiles" `
|
|
|
|
-b missing `
|
|
|
|
--output-folder=. `
|
|
|
|
-o with_openssl3="$Env:C2_USE_OPENSSL3"
|
|
|
|
|
2024-06-09 12:37:18 +02:00
|
|
|
# The Windows runners currently use an older version of the CRT
|
|
|
|
- name: Install CRT
|
|
|
|
run: |
|
|
|
|
mkdir -Force build-test/bin
|
|
|
|
cp "$((ls $Env:VCToolsRedistDir/onecore/x64 -Filter '*.CRT')[0].FullName)/*" build-test/bin
|
|
|
|
|
2024-10-18 21:23:13 +02:00
|
|
|
- name: Install httpbox
|
|
|
|
run: |
|
|
|
|
mkdir httpbox
|
|
|
|
Invoke-WebRequest -Uri "https://github.com/Chatterino/httpbox/releases/download/${{ env.HTTPBOX_TAG }}/httpbox-x86_64-pc-windows-msvc.zip" -outfile "httpbox.zip"
|
|
|
|
Expand-Archive httpbox.zip -DestinationPath httpbox
|
|
|
|
rm httpbox.zip
|
|
|
|
|
2023-11-18 15:13:27 +01:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cmake `
|
|
|
|
-G"NMake Makefiles" `
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
|
|
|
-DBUILD_TESTS=On `
|
|
|
|
-DBUILD_APP=OFF `
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" `
|
|
|
|
-DUSE_PRECOMPILED_HEADERS=On `
|
|
|
|
-DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" `
|
|
|
|
-DCHATTERINO_PLUGINS="$Env:C2_PLUGINS" `
|
|
|
|
-DBUILD_WITH_QT6="$Env:C2_BUILD_WITH_QT6" `
|
|
|
|
..
|
|
|
|
set cl=/MP
|
|
|
|
nmake /S /NOLOGO
|
|
|
|
working-directory: build-test
|
|
|
|
|
|
|
|
- name: Download and extract Twitch PubSub Server Test
|
|
|
|
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"
|
|
|
|
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 ..
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
timeout-minutes: 30
|
|
|
|
run: |
|
2024-10-18 21:23:13 +02:00
|
|
|
..\httpbox\httpbox.exe --port 9051 &
|
2023-11-18 15:13:27 +01:00
|
|
|
cd ..\pubsub-server-test
|
|
|
|
.\server.exe 127.0.0.1:9050 &
|
|
|
|
cd ..\build-test
|
2024-09-29 12:20:06 +02:00
|
|
|
ctest --repeat until-pass:4 --output-on-failure
|
2023-11-18 15:13:27 +01:00
|
|
|
working-directory: build-test
|
|
|
|
|
|
|
|
- name: Clean Conan cache
|
|
|
|
run: conan cache clean --source --build --download "*"
|