name: tests on: push: branches: ["**"] pull_request: schedule: - cron: "0 2 * * *" workflow_dispatch: concurrency: group: tests-${{ github.ref }} cancel-in-progress: true jobs: linux: runs-on: linux timeout-minutes: 90 env: BILAUNCHER_REQUIRE_FAKE_INTERNET: "1" steps: - uses: actions/checkout@v4 - name: Сборка лаунчера и тестов run: | export PATH="$QT_TOOLS/CMake/bin:$QT_TOOLS/Ninja:$PATH" launcher="" if command -v ccache >/dev/null; then launcher="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" fi cmake -S . -B build-tests -G Ninja -DCMAKE_BUILD_TYPE=Debug \ -DBILAUNCHER_BUILD_TESTS=ON -DCMAKE_PREFIX_PATH="$QT_ROOT" $launcher cmake --build build-tests -j 8 - name: Статические проверки (переводы, qmllint, CHANGELOG) run: CMAKE="$QT_TOOLS/CMake/bin/cmake" python3 tests/scripts/static_checks.py build-tests - name: Тесты run: | export PATH="$QT_TOOLS/CMake/bin:$PATH" ctest --test-dir build-tests --output-on-failure -j 4 \ --output-junit "$PWD/build-tests/junit.xml" - name: Отчёты if: always() uses: actions/upload-artifact@v4 with: name: tests-linux if-no-files-found: ignore path: | build-tests/junit.xml build-tests/qmllint.log build-tests/Testing/Temporary/LastTest.log windows: if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' runs-on: windows timeout-minutes: 150 steps: - uses: actions/checkout@v4 - name: Сборка и тесты shell: powershell run: | $ErrorActionPreference = "Stop" # Короткий путь: дерево WebEngine легко вылезает за MAX_PATH (см. release.yml). $build = "C:\r\bl-tests" Remove-Item -Recurse -Force $build -ErrorAction SilentlyContinue $vs = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * ` -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath Import-Module "$vs\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64" $env:PATH = "$env:QT_TOOLS\CMake_64\bin;$env:QT_TOOLS\Ninja;$env:PATH" cmake -S . -B $build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBILAUNCHER_BUILD_TESTS=ON "-DCMAKE_PREFIX_PATH=$env:QT_ROOT" if ($LASTEXITCODE) { throw "cmake configure" } cmake --build $build if ($LASTEXITCODE) { throw "cmake build" } ctest --test-dir $build --output-on-failure --output-junit "$build\junit.xml" $code = $LASTEXITCODE New-Item -ItemType Directory -Force test-results | Out-Null Copy-Item "$build\junit.xml" test-results\ -ErrorAction SilentlyContinue if ($code) { throw "ctest" } - name: Отчёты if: always() uses: actions/upload-artifact@v4 with: name: tests-windows if-no-files-found: ignore path: test-results/ macos: if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' runs-on: macos timeout-minutes: 120 steps: - uses: actions/checkout@v4 - name: Сборка и тесты run: | export PATH="$QT_TOOLS/CMake/CMake.app/Contents/bin:$QT_TOOLS/Ninja:$PATH" cmake -S . -B build-tests -G Ninja -DCMAKE_BUILD_TYPE=Debug \ -DBILAUNCHER_BUILD_TESTS=ON -DCMAKE_PREFIX_PATH="$QT_ROOT" cmake --build build-tests ctest --test-dir build-tests --output-on-failure -j 4 \ --output-junit "$PWD/build-tests/junit.xml" - name: Отчёты if: always() uses: actions/upload-artifact@v4 with: name: tests-macos if-no-files-found: ignore path: build-tests/junit.xml package-smoke-linux: if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: linux timeout-minutes: 90 steps: - uses: actions/checkout@v4 - name: Release-сборка, установка, запуск run: | export PATH="$QT_TOOLS/CMake/bin:$QT_TOOLS/Ninja:$PATH" rm -rf build-smoke smoke-stage launcher="" if command -v ccache >/dev/null; then launcher="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" fi cmake -S . -B build-smoke -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="$QT_ROOT" \ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib $launcher cmake --build build-smoke -j 8 cmake --install build-smoke --prefix "$PWD/smoke-stage/usr" bash tests/scripts/smoke_installed.sh smoke-stage/usr package-smoke-windows: if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: windows timeout-minutes: 150 steps: - uses: actions/checkout@v4 - name: Release-сборка, установка, запуск shell: powershell run: | $ErrorActionPreference = "Stop" $build = "C:\r\bl-smoke"; $stage = "C:\r\bl-smoke-stage" Remove-Item -Recurse -Force $build, $stage -ErrorAction SilentlyContinue $vs = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * ` -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath Import-Module "$vs\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64" $env:PATH = "$env:QT_TOOLS\CMake_64\bin;$env:QT_TOOLS\Ninja;$env:PATH" cmake -S . -B $build -G Ninja -DCMAKE_BUILD_TYPE=Release "-DCMAKE_PREFIX_PATH=$env:QT_ROOT" if ($LASTEXITCODE) { throw "cmake configure" } cmake --build $build if ($LASTEXITCODE) { throw "cmake build" } cmake --install $build --prefix $stage if ($LASTEXITCODE) { throw "cmake install" } & powershell -ExecutionPolicy Bypass -File tests\scripts\smoke_installed.ps1 -Prefix $stage if ($LASTEXITCODE) { throw "smoke" } Remove-Item -Recurse -Force $build, $stage -ErrorAction SilentlyContinue package-smoke-macos: if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: macos timeout-minutes: 120 steps: - uses: actions/checkout@v4 - name: Release-сборка, установка, запуск run: | export PATH="$QT_TOOLS/CMake/CMake.app/Contents/bin:$QT_TOOLS/Ninja:$PATH" rm -rf build-smoke smoke-stage cmake -S . -B build-smoke -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_ROOT" cmake --build build-smoke cmake --install build-smoke --prefix "$PWD/smoke-stage" bash tests/scripts/smoke_installed.sh smoke-stage