CI #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a basic workflow to help you get started with Actions | |
| name: CI | |
| env: | |
| DISPLAY: ':99' | |
| ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
| # Controls when the action will run. Triggers the workflow on push, pull request, | |
| # or manual workflow dispatch events. | |
| # | |
| # The nightly `schedule:` trigger is inherited from upstream and dropped on this | |
| # fork: it burns runner minutes on release plumbing this fork does not publish. | |
| # The jobs gated on `github.event_name == 'schedule'` (window-msvc2022-build, the | |
| # two peloton-bike builds, upload_to_release) are therefore dormant, and are left | |
| # gated that way so restoring the cron restores them. | |
| # | |
| # Note on duplicate runs: `push` is already restricted to master, so a push to a | |
| # feature branch with an open PR produces one run, not two. A manual | |
| # workflow_dispatch on a branch that also has a PR open is still two runs - that | |
| # is the dispatch, not the push, and the fix is not to dispatch by hand. | |
| # | |
| # Releases: pushing a `v*` tag builds and publishes to GitHub Releases via the | |
| # `release` job at the bottom. The tag must match QZ_FORK_VERSION in | |
| # src/qzforkversion.h - the job checks and fails the release rather than shipping | |
| # assets whose version string disagrees with their name. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main, github-workflow-playground ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| # Leave this as is - but note that a superseded run reports `cancelled`, not | |
| # failed. Any tooling polling a run ID must treat `cancelled` as "find the newer | |
| # run" rather than reporting CI failure. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| # Settings are declared in four places that nothing keeps in agreement at build time - | |
| # qzsettings.h, allSettings[] in qzsettings.cpp, settings-catalog.json, and settings.qml, | |
| # which resolves them by name at runtime. A key deleted from one and left in another is | |
| # a dead control on the bike rather than a compile error, which is tolerable while | |
| # settings are only added and not while several hundred are being removed. | |
| # | |
| # Deliberately standalone: no Qt, no build, no `needs:`. It answers in seconds, which is | |
| # what makes it useful as the first thing to look at on a PR. | |
| settings-integrity: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Check settings declarations agree | |
| run: python tools/check-settings-integrity.py | |
| window-build: | |
| runs-on: windows-2022 | |
| strategy: | |
| # Only the no-python artifact is used here, and building both halves of the | |
| # matrix cost more than runtime: fail-fast cancels the sibling the moment one | |
| # side fails, so the cancelled job's log filled up with "The operation was | |
| # canceled" mid-download and read like a second, separate failure. The python | |
| # half also drags in paddleocr and a bundled interpreter for the Zwift-workout | |
| # OCR and NordicTrack ADB paths, neither of which is wanted on this fork. | |
| matrix: | |
| config: | |
| - {python: false} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout submodule repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bluetiger9/SmtpClient-for-Qt | |
| path: "src/smtpclient/" | |
| ref: 863843c34e03b50d41b8ae8ab6af00e9351693ca # v2.0: the first SmtpClient with Qt 6 support | |
| - name: Checkout googletest | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: google/googletest | |
| path: "tst/googletest/" | |
| ref: "release-1.12.1" | |
| - name: Checkout MSIX-Toolkit | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: microsoft/MSIX-Toolkit | |
| path: "src/MSIX-Toolkit/" | |
| ref: b82af826d29e93e4c85d34fad8a405b6c49905e7 | |
| - name: Checkout qHttpServer | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: qt-labs/qthttpserver | |
| path: "src/qthttpserver" | |
| # QZ patches Qt's Bluetooth module. The result used to be a committed 30 MB | |
| # DLL with no recorded provenance and no way to rebuild it; it is built from | |
| # source here instead, exactly the way qthttpserver already is. Pinned to the | |
| # tag matching the Qt this job installs - a mismatch here is an ABI mismatch. | |
| - name: Checkout qtconnectivity | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: qt/qtconnectivity | |
| ref: v5.15.2 | |
| path: "src/qtconnectivity" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.7' | |
| cache: 'pip' | |
| cache-dependency-path: .github/workflows/main.yml | |
| - name: download python and paddleocr | |
| run: | | |
| python -VV | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install "protobuf<=3.20.2,>=3.1.0" | |
| python -m pip install paddlepaddle==2.5.1 | |
| python -m pip install paddleocr | |
| python -m pip install imutils | |
| python -m pip install "Pillow<10.0.0" | |
| python -m pip install opencv-python | |
| python -m pip install numpy | |
| python -m pip install pywin32 | |
| if: matrix.config.python | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-qt5-webview | |
| msystem: mingw64 | |
| release: false | |
| - name: Setup cmake | |
| uses: jwlawson/actions-setup-cmake@v1.9 | |
| with: | |
| cmake-version: '3.20.x' | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '5.15.2' | |
| host: 'windows' | |
| modules: 'qtnetworkauth qtcharts' | |
| target: "desktop" | |
| arch: win64_mingw81 | |
| dir: "${{github.workspace}}/qt/" | |
| install-deps: "true" | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-windows' | |
| # The action's default aqtinstall is 3.1.21, which cannot read the | |
| # archives any more: py7zr went to 1.x and tightened path validation, so | |
| # extraction dies with "Bad7zFile: Specified path is bad: | |
| # 5.15.2/mingw81_64/lib/cmake/Qt5AxContainer". aqt 3.3.0 handles py7zr 1.x. | |
| # This only began biting once a cache miss forced a real download - the | |
| # cancelled run before it never got to save its cache. | |
| aqtversion: '==3.3.0' | |
| - name: Cache qthttpserver build | |
| id: cache-qthttpserver-mingw | |
| uses: actions/cache@v4 | |
| with: | |
| path: src/qthttpserver | |
| key: qthttpserver-mingw-${{ runner.os }}-qt5.15.2-v1 | |
| - name: download 3rd party files for qthttpserver | |
| if: steps.cache-qthttpserver-mingw.outputs.cache-hit != 'true' | |
| run: | | |
| cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Build qthttpserver | |
| if: steps.cache-qthttpserver-mingw.outputs.cache-hit != 'true' | |
| run: | | |
| cd src\qthttpserver | |
| # Only the libraries are wanted here. qt_parts.prf adds examples/ and | |
| # tests/ to SUBDIRS whenever those .pro files exist, and QT_BUILD_PARTS | |
| # does not help: it only marks them no_default_target, which keeps make | |
| # from building them but does not keep qmake -r from recursing in. | |
| # examples/httpserver then aborts qmake outright with "You cannot build | |
| # examples inside the Qt source tree". | |
| Remove-Item -Recurse -Force examples -ErrorAction SilentlyContinue | |
| # tests/ is emptied rather than deleted. Deleting it took tests/auto/cmake | |
| # with it, and qt_module.prf sets CONFIG += create_cmake unconditionally - | |
| # that feature then stops with "Missing CMake tests". Passing | |
| # CONFIG-=create_cmake on the command line does not answer it either: | |
| # qmake applies command-line assignments before reading the project, and | |
| # qt_module.prf adds the flag straight back afterwards. Replacing the .pro | |
| # with an empty subdirs project keeps the directory create_cmake looks for | |
| # while giving qmake -r nothing to walk into, which settles both without | |
| # depending on assignment ordering. | |
| Set-Content -Path tests\tests.pro -Value "TEMPLATE = subdirs" | |
| # -r is load-bearing, for a reason that is not obvious. A plain qmake | |
| # writes only the top Makefile and defers each submodule's qmake to make | |
| # time: | |
| # cd sslserver/ && ( test -e Makefile || qmake -o Makefile ... ) && make | |
| # that nested qmake inherits make's shell, where perl reports MSYS-style | |
| # paths - syncqt logged <srcbase> = /d/a/qz/... against the | |
| # <bldbase> = D:/a/qz/... it was given, took them for different roots, and | |
| # wrote every forwarding header as a relative path climbing between them. | |
| # Recursing here instead runs syncqt in-process from pwsh, where both come | |
| # out as D:/a/qz/..., and the generated headers are simply correct. | |
| qmake -r | |
| # Guard, not the fix. With qmake -r above the headers come out correct | |
| # already - the run that introduced this reported "25 scanned, 0 | |
| # repaired". It stays because the failure it catches is silent and | |
| # extremely hard to read backwards from, and it costs one pass over 25 | |
| # files. It always prints its counts, so a no-op can never again be | |
| # mistaken for a fix that worked. | |
| $repaired = 0 | |
| $scanned = 0 | |
| if (Test-Path include) { | |
| Get-ChildItem -Path include -Recurse -Filter *.h | ForEach-Object { | |
| $scanned++ | |
| $c = Get-Content -Raw $_.FullName | |
| $n = [regex]::Replace($c, '#include "(?:\.\./)+([a-zA-Z])/([^"]+)"', '#include "$1:/$2"') | |
| if ($n -ne $c) { Set-Content -Path $_.FullName -Value $n -NoNewline; $repaired++; Write-Host "repaired forwarding header: $($_.FullName)" } | |
| } | |
| } else { Write-Host "NOTE: include/ does not exist after qmake -r" } | |
| Write-Host "forwarding headers: $scanned scanned, $repaired repaired" | |
| make -j8 | |
| cd ../.. | |
| - name: Install qthttpserver | |
| run: | | |
| cd src\qthttpserver | |
| make install | |
| cd ../.. | |
| - name: Cache qtconnectivity build | |
| id: cache-qtconnectivity-mingw | |
| uses: actions/cache@v4 | |
| with: | |
| path: src/qtconnectivity | |
| # Keyed on the patches themselves: edit one and the module rebuilds, | |
| # leave them alone and this is a cache hit. | |
| key: qtconnectivity-mingw-${{ runner.os }}-qt5.15.2-${{ hashFiles('qt-patches/windows/5.15.2/qlowenergycontroller_win.cpp', 'qt-patches/windows/5.15.2/qlowenergycontroller_winrt.cpp', 'qt-patches/windows/5.15.2/qlowenergycontroller_winrt_new.cpp') }} | |
| - name: Apply QZ bluetooth patches | |
| if: steps.cache-qtconnectivity-mingw.outputs.cache-hit != 'true' | |
| run: | | |
| cp qt-patches/windows/5.15.2/qlowenergycontroller_win.cpp src/qtconnectivity/src/bluetooth/ | |
| cp qt-patches/windows/5.15.2/qlowenergycontroller_winrt.cpp src/qtconnectivity/src/bluetooth/ | |
| cp qt-patches/windows/5.15.2/qlowenergycontroller_winrt_new.cpp src/qtconnectivity/src/bluetooth/ | |
| - name: Build qtconnectivity | |
| if: steps.cache-qtconnectivity-mingw.outputs.cache-hit != 'true' | |
| run: | | |
| cd src\qtconnectivity | |
| # Same two obstacles qthttpserver hit - see that step for the long | |
| # version. examples/ aborts qmake inside a Qt source tree, and tests/ is | |
| # emptied rather than deleted so create_cmake still finds the directory. | |
| Remove-Item -Recurse -Force examples -ErrorAction SilentlyContinue | |
| Set-Content -Path tests\tests.pro -Value "TEMPLATE = subdirs" | |
| # -feature-native-win32-bluetooth selects the Win32 backend on purpose. | |
| # It is the opt-in: qtconnectivity's winrt_bt feature is conditioned on | |
| # `config.win32 && !features.native-win32-bluetooth && tests.winrt_bt`, | |
| # and native-win32-bluetooth is autoDetect:false - so WinRT is the | |
| # default on any win32 build whose compile test passes. Today that test | |
| # fails under mingw and Win32 is selected by accident. Asking for it | |
| # explicitly means a future toolchain that happens to pass the test | |
| # cannot silently switch backends and discard the patches applied above. | |
| # See docs/fork/WINDOWS-WINRT-PHASE0.md. | |
| qmake -r -- -feature-native-win32-bluetooth | |
| make -j8 | |
| cd ../.. | |
| # Installs the patched Qt5Bluetooth.dll over the one aqtinstall laid down, so | |
| # windeployqt picks it up like any other Qt module. This replaces the old | |
| # "patching qt for bluetooth" step, which copied a committed DLL into the | |
| # output directory after the fact. | |
| - name: Install qtconnectivity | |
| run: | | |
| cd src\qtconnectivity | |
| make install | |
| cd ../.. | |
| - name: Secrets | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| cd .. | |
| - name: Build | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| qmake | |
| make -j8 | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp "C:/mingw64/bin/libwinpthread-1.dll" . | |
| cp "C:/mingw64/bin/libgcc_s_seh-1.dll" . | |
| cp "C:/mingw64/bin/libstdc++-6.dll" . | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../windows/*.py . | |
| cp ../../windows/*.bat . | |
| cp ../../../windows_openssl/*.* . | |
| mkdir adb | |
| mkdir python | |
| Copy-Item -Path C:\hostedtoolcache\windows\Python\3.7.9\x64 -Destination python -Recurse | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python | |
| - name: Build without python | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| qmake | |
| make -j8 | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| # The exe lands here around 346 MB because CI builds src/debug, and the | |
| # artifact is downloaded by hand on every iteration. Discarding the debug | |
| # symbols takes it to roughly a tenth of that. Nothing else changes - the | |
| # import table windeployqt reads is untouched, and the only thing given up | |
| # is symbolised stack traces. | |
| Write-Host ("before strip: {0:N0} bytes" -f (Get-Item qdomyos-zwift.exe).Length) | |
| strip qdomyos-zwift.exe | |
| Write-Host ("after strip: {0:N0} bytes" -f (Get-Item qdomyos-zwift.exe).Length) | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp "C:/mingw64/bin/libwinpthread-1.dll" . | |
| cp "C:/mingw64/bin/libgcc_s_seh-1.dll" . | |
| cp "C:/mingw64/bin/libstdc++-6.dll" . | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../../windows_openssl/*.* . | |
| mkdir adb | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python == false | |
| # The patched Qt5Bluetooth.dll is no longer copied in here. It is built from | |
| # source and installed into the Qt prefix above, so windeployqt has already | |
| # deployed it by this point. | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-binary.zip | |
| if: matrix.config.python | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-binary | |
| path: windows-binary.zip | |
| if: matrix.config.python | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-binary-no-python | |
| path: windows-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| # The exe alone, for dropping into an existing C:\QZ\... install. The full | |
| # no-python zip is ~62 MB and has failed mid-transfer; this is the stripped | |
| # exe only, and downloads in seconds. | |
| # | |
| # CAVEAT: this is only a drop-in replacement while the Qt DLL set is | |
| # unchanged. Any commit touching the `QT +=` line in src/qdomyos-zwift.pri, | |
| # the Qt version, or the toolchain needs the full windows-binary-no-python | |
| # artifact instead. The check is the build header QZ logs on launch: if the | |
| # Qt version there does not match the DLLs in the install, take the full one. | |
| - name: Archive windows exe only | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-exe-only | |
| path: src/debug/output/qdomyos-zwift.exe | |
| compression-level: 9 | |
| retention-days: 7 | |
| if: ${{ ! matrix.config.python }} | |
| # - name: Exit if not on master branch | |
| # if: github.ref == 'refs/heads/master' | |
| # run: exit 1 | |
| # - uses: actions/checkout@v3 | |
| # with: | |
| # fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags | |
| # - name: Get previous tag | |
| # id: previoustag | |
| # uses: 'WyriHaximus/github-action-get-previous-tag@v1' | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Create Release | |
| # if: ${{ ! matrix.config.python }} | |
| # id: create_release | |
| # uses: actions/create-release@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # tag_name: ${{ steps.previoustag.outputs.tag }} | |
| # release_name: Release ${{ steps.previoustag.outputs.tag }} | |
| # draft: false | |
| # prerelease: false | |
| # - name: upload windows artifact | |
| # uses: actions/upload-release-asset@v1 | |
| # if: ${{ ! matrix.config.python }} | |
| # env: | |
| # GITHUB_TOKEN: ${{ github.token }} | |
| # with: | |
| # upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| # asset_path: release.zip | |
| # asset_name: windows-binary-no-python.zip | |
| # asset_content_type: application/zip | |
| # - name: upload windows artifact | |
| # uses: actions/upload-release-asset@v1 | |
| # if: ${{ matrix.config.python }} | |
| # env: | |
| # GITHUB_TOKEN: ${{ github.token }} | |
| # with: | |
| # upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| # asset_path: release.zip | |
| # asset_name: windows-binary.zip | |
| # asset_content_type: application/zip | |
| # window-steam-build: | |
| # runs-on: windows-2022 | |
| # | |
| # steps: | |
| # - uses: actions/checkout@v2 | |
| # - name: Checkout submodule repo | |
| # uses: actions/checkout@v2 | |
| # with: | |
| # repository: bluetiger9/SmtpClient-for-Qt | |
| # path: "src/smtpclient/" | |
| # ref: 863843c34e03b50d41b8ae8ab6af00e9351693ca # v2.0: the first SmtpClient with Qt 6 support | |
| # | |
| # | |
| # - uses: msys2/setup-msys2@v2 | |
| # with: | |
| # install: mingw-w64-x86_64-toolchain | |
| # msystem: mingw64 | |
| # release: false | |
| # | |
| # - name: Setup cmake | |
| # uses: jwlawson/actions-setup-cmake@v1.9 | |
| # with: | |
| # cmake-version: '3.20.x' | |
| # | |
| # - name: Install Qt | |
| # uses: jurplel/install-qt-action@v2 | |
| # with: | |
| # version: '5.15.2' | |
| # host: 'windows' | |
| # modules: 'qtnetworkauth qtcharts' | |
| # target: "desktop" | |
| # arch: win64_mingw81 | |
| # dir: "${{github.workspace}}/qt/" | |
| # install-deps: "true" | |
| # | |
| # - name: Build | |
| # run: | | |
| # qmake | |
| # cd src | |
| # echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| # echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| # echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| # echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| # echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| # echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| # echo "#define STEAM_STORE" >> secret.h | |
| # cd .. | |
| # make -j8 | |
| # cd src/debug | |
| # mkdir output | |
| # mkdir appx | |
| # cp qdomyos-zwift.exe output/ | |
| # cd output | |
| # windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| # cp "${{github.workspace}}/qt/Qt/5.15.2/mingw81_64/bin/libwinpthread-1.dll" . | |
| # cp "${{github.workspace}}/qt/Qt/5.15.2/mingw81_64/bin/libgcc_s_seh-1.dll" . | |
| # cp "${{github.workspace}}/qt/Qt/5.15.2/mingw81_64/bin/libstdc++-6.dll" . | |
| # | |
| # - uses: game-ci/steam-deploy@v1 | |
| # with: | |
| # username: ${{ secrets.STEAM_USERNAME }} | |
| # password: ${{ secrets.STEAM_PASSWORD }} | |
| # configVdf: ${{ secrets.STEAM_CONFIG_VDF}} | |
| # ssfnFileName: ${{ secrets.STEAM_SSFN_FILE_NAME }} | |
| # ssfnFileContents: ${{ secrets.STEAM_SSFN_FILE_CONTENTS }} | |
| # appId: 2267200 | |
| # buildDescription: 2.12 | |
| # rootPath: src/debug/output | |
| # depot1Path: ./ | |
| # #depot2Path: StandaloneLinux64 | |
| # releaseBranch: prerelease | |
| # The Qt 6 Windows build, and the reason the fork has an MSVC job at all. | |
| # | |
| # Qt ships a working WinRT Bluetooth backend only for MSVC: QT_FEATURE_winrt_bt | |
| # is 1 in the msvc2022 package and -1 in every mingw one (6.8.2, 6.9.3, 6.10.3 | |
| # and llvm-mingw alike), where you get qlowenergycontroller_dummy.cpp instead. | |
| # docs/fork/WINDOWS-QT6-PHASE1.md has the measurements and why building it under mingw is | |
| # a fork of Qt rather than a build of it. | |
| # | |
| # window-build stays on mingw + Qt 5.15.2 until this one has been proven against | |
| # the bike - it is the known-good artifact, and the two do not conflict. | |
| # | |
| # Differences from window-build worth knowing: | |
| # - no qthttpserver checkout: Qt 6 has QtHttpServer as a real module. | |
| # - no qtconnectivity source build: the WinRT backend is already in the package, | |
| # and the fork's Qt 5 patches are all against backends Qt 6 does not have. | |
| # - protobuf comes from vcpkg, because zwift_messages.pb.cc is compiled only | |
| # under msvc (see the `msvc {` block in src/qdomyos-zwift.pri). | |
| window-qt6-build: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout smtpclient | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bluetiger9/SmtpClient-for-Qt | |
| path: "src/smtpclient/" | |
| ref: 863843c34e03b50d41b8ae8ab6af00e9351693ca # v2.0: the first SmtpClient with Qt 6 support | |
| - name: Checkout googletest | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: google/googletest | |
| path: "tst/googletest/" | |
| ref: "release-1.12.1" | |
| - name: Install Qt 6 | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '6.8.2' | |
| host: 'windows' | |
| modules: 'qtconnectivity qtpositioning qtnetworkauth qtwebsockets qtspeech qtlocation qtmultimedia qtcharts qthttpserver qtshadertools qtimageformats' | |
| target: "desktop" | |
| arch: win64_msvc2022_64 | |
| dir: "${{github.workspace}}/qt/" | |
| install-deps: "true" | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-windows-qt6' | |
| aqtversion: '==3.3.0' | |
| - name: Install MSVC compiler | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| - name: Cache vcpkg | |
| id: cache-vcpkg-qt6 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.workspace }}\vcpkg\installed | |
| key: vcpkg-qt6-x64-windows-protobuf-abseil-v1 | |
| - name: Clone vcpkg | |
| if: steps.cache-vcpkg-qt6.outputs.cache-hit != 'true' | |
| run: git clone https://github.com/microsoft/vcpkg.git | |
| working-directory: ${{ runner.workspace }} | |
| - name: Bootstrap vcpkg | |
| if: steps.cache-vcpkg-qt6.outputs.cache-hit != 'true' | |
| run: .\vcpkg\bootstrap-vcpkg.bat | |
| working-directory: ${{ runner.workspace }} | |
| # Pinned to the same baseline the msvc2022 job uses. zwift_messages.pb.h | |
| # refuses anything older than protobuf 4.25.0 and anything whose runtime | |
| # demands a protoc newer than 4.25.1, so this is not a version to float. | |
| - name: Create vcpkg.json | |
| if: steps.cache-vcpkg-qt6.outputs.cache-hit != 'true' | |
| working-directory: ${{ runner.workspace }} | |
| run: | | |
| echo '{ | |
| "name": "qdomyos-zwift", | |
| "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | |
| "dependencies": [ | |
| "protobuf", | |
| "protobuf-c", | |
| "abseil" | |
| ], | |
| "builtin-baseline": "8c2fcacefba009d63672f9d137f192765e632c9f" | |
| }' > vcpkg.json | |
| - name: Install dependencies | |
| if: steps.cache-vcpkg-qt6.outputs.cache-hit != 'true' | |
| run: | | |
| .\vcpkg\vcpkg install --triplet x64-windows --x-install-root=${{ runner.workspace }}\vcpkg\installed | |
| working-directory: ${{ runner.workspace }} | |
| - name: Secrets | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| cd .. | |
| # Every command's status is checked. window-build does not do this, and as a | |
| # result it has been reporting success while `make` failed on the tst | |
| # subproject - in a pwsh run: block only the last command's exit code reaches | |
| # GitHub, and there are half a dozen cp's after the build. | |
| - name: Build | |
| run: | | |
| $vcpkg = "${{ runner.workspace }}\vcpkg\installed\x64-windows" | |
| lrelease src/qdomyos-zwift.pri | |
| if ($LASTEXITCODE -ne 0) { throw "lrelease failed: $LASTEXITCODE" } | |
| # protobuf's headers and import libraries are handed to qmake rather than | |
| # copied into src/, so the source tree stays clean. VCPKG rather than a | |
| # raw -L: defaults.pri has to pick the debug or release half to match the | |
| # CRT, and only it knows which side of debug|release this build is on. | |
| qmake "VCPKG=$vcpkg" | |
| if ($LASTEXITCODE -ne 0) { throw "qmake failed: $LASTEXITCODE" } | |
| # `debug`, not the default target: qmake writes debug and release | |
| # makefiles for every subproject, and left alone nmake builds src in | |
| # debug and then tries tst in release, against a library that was never | |
| # built. Naming the target keeps all three on the same side. | |
| nmake debug | |
| if ($LASTEXITCODE -ne 0) { throw "nmake failed: $LASTEXITCODE" } | |
| - name: Run the tests | |
| run: | | |
| # A debug build links vcpkg's debug protobuf and abseil, and those DLLs | |
| # live in debug/bin, which nothing has put on PATH. Without this the exe | |
| # dies before main() with 0xC0000135 STATUS_DLL_NOT_FOUND, surfacing as | |
| # "tests failed: -1073741515" - a loader failure wearing a test failure's | |
| # clothes. Qt's own bin is already on PATH from install-qt-action. | |
| $vcpkg = "${{ runner.workspace }}\vcpkg\installed\x64-windows" | |
| $env:PATH = "$vcpkg\debug\bin;$vcpkg\bin;" + $env:PATH | |
| tst\debug\qdomyos-zwift-tests.exe | |
| if ($LASTEXITCODE -ne 0) { throw "tests failed: $LASTEXITCODE" } | |
| - name: Deploy | |
| run: | | |
| $vcpkg = "${{ runner.workspace }}\vcpkg\installed\x64-windows" | |
| cd src/debug | |
| mkdir output | |
| cp qdomyos-zwift.exe output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| if ($LASTEXITCODE -ne 0) { throw "windeployqt failed: $LASTEXITCODE" } | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| Copy-Item -Path "$vcpkg\bin\*.dll" -Destination . -Verbose | |
| mkdir adb | |
| cp ../../adb/* adb/ | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-qt6-binary.zip | |
| - name: Archive windows qt6 binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-qt6-binary | |
| path: windows-qt6-binary.zip | |
| # The exe alone, for dropping into an existing install while iterating. Only | |
| # valid while the Qt DLL set is unchanged - the build banner QZ logs on launch | |
| # is the check. | |
| - name: Archive windows qt6 exe only | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-qt6-exe-only | |
| path: src/debug/output/qdomyos-zwift.exe | |
| compression-level: 9 | |
| retention-days: 7 | |
| # Re-enabled as a tests-only job: this is the only job in the workflow that runs | |
| # the gtest suite at all, and 753ff0e5 disabled it when the fork was cut down to | |
| # Android + Windows. Every test written since has been run by hand in a build VM. | |
| # It deliberately does not publish a Linux binary - the fork does not ship one - | |
| # and it is not in any `needs:` chain, so it runs in parallel with the Windows | |
| # build rather than adding its minutes to that critical path. | |
| linux-x86-build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-24.04 | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # - name: Cache Qt Linux Desktop | |
| # id: cache-qt-linux-desktop | |
| # uses: actions/cache@v1 | |
| # with: | |
| # path: '${{ github.workspace }}/output/linux-desktop/' | |
| # key: ${{ runner.os }}-QtCache-Linux-Desktop | |
| # - name: Cache Qt Linux Android | |
| # id: cache-qt-android | |
| # uses: actions/cache@v1 | |
| # with: | |
| # path: '${{ github.workspace }}/output/android/' | |
| # key: ${{ runner.os }}-QtCache-Android | |
| - name: Xvfb install and run | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb -ac ${{ env.DISPLAY }} -screen 0 1280x780x24 & | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Checkout submodule repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bluetiger9/SmtpClient-for-Qt | |
| path: "src/smtpclient/" | |
| ref: 863843c34e03b50d41b8ae8ab6af00e9351693ca # v2.0: the first SmtpClient with Qt 6 support | |
| - name: Checkout googletest | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: google/googletest | |
| path: "tst/googletest/" | |
| ref: "release-1.12.1" | |
| - name: Checkout qHttpServer | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: qt-labs/qthttpserver | |
| path: "src/qthttpserver" | |
| - name: Install packages required to run QZ inside workflow | |
| run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev qtbase5-dev libqt5sql5-sqlite libqt5sql5 libqt5sql5-mysql libqt5sql5-psql | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '5.15.2' | |
| host: 'linux' | |
| modules: 'qtnetworkauth qtcharts' | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-linux' | |
| # Same pin as window-build, and for the same reason - see a29d74f5. The | |
| # action's default aqtinstall 3.1.21 cannot extract the 5.15.2 archives | |
| # against py7zr 1.x. Do not float this. | |
| aqtversion: '==3.3.0' | |
| - name: Cache qthttpserver build | |
| id: cache-qthttpserver-linux | |
| uses: actions/cache@v4 | |
| with: | |
| path: src/qthttpserver | |
| key: qthttpserver-linux-${{ runner.os }}-qt5.15.2-v1 | |
| - name: download 3rd party files for qthttpserver | |
| if: steps.cache-qthttpserver-linux.outputs.cache-hit != 'true' | |
| run: | | |
| cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Build qthttpserver | |
| if: steps.cache-qthttpserver-linux.outputs.cache-hit != 'true' | |
| run: | | |
| cd src/qthttpserver | |
| qmake | |
| make -j8 | |
| cd ../.. | |
| - name: Install qthttpserver | |
| run: | | |
| cd src/qthttpserver | |
| make install | |
| cd ../.. | |
| - name: Compile Linux Desktop | |
| run: qmake; make -j8 | |
| - name: Test | |
| run: cd tst; GTEST_OUTPUT=xml:test-results/ GTEST_COLOR=1 ./qdomyos-zwift-tests; cd .. | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: test_results_xml | |
| path: tst/test-results/**/*.xml | |
| - name: Upload test FIT files and database | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: test_fit_files_and_db | |
| path: | | |
| tst/test-artifacts/*.fit | |
| tst/test-artifacts/*.sqlite | |
| # - name: Test Peloton API | |
| # if: github.event_name == 'push' || github.event_name == 'schedule' | |
| # run: cd /home/runner/work/qdomyos-zwift/qdomyos-zwift/src/; ./qdomyos-zwift -test-peloton -peloton-username ${{ secrets.peloton_username }} -peloton-password ${{ secrets.peloton_password }} | |
| # timeout-minutes: 2 | |
| # - name: Test Home Fitness Buddy API | |
| # run: cd /home/runner/work/qdomyos-zwift/qdomyos-zwift/src/; ./qdomyos-zwift -test-hfb | |
| # timeout-minutes: 2 | |
| # - uses: actions/checkout@v2 | |
| # with: | |
| # repository: nttld/setup-ndk | |
| # path: setup-ndk | |
| # The packages.json in nttld/setup-ndk has already been updated, | |
| # https://github.com/nttld/setup-ndk/commit/831db5b02a0f0cab80614619efe461a3dcc140e6 | |
| # but `dist/*` has not been rebuilt yet. Build it. | |
| # https://github.com/nttld/setup-ndk/tree/main/dist | |
| # - name: Locally rebuilt setup-ndk | |
| # run: | | |
| # npm -prefix ./setup-ndk install | |
| # npm -prefix ./setup-ndk run all | |
| # Install using locally rebuilt setup-ndk | |
| # - name: Setup Android NDK r21d | |
| # uses: ./setup-ndk | |
| #- uses: nttld/setup-ndk@v1 | |
| # with: | |
| # ndk-version: r21d | |
| # waiting github.com/jurplel/install-qt-action/issues/63 | |
| # - name: Install Qt Android | |
| # uses: jurplel/install-qt-action@v2 | |
| # with: | |
| # version: '5.12.9' | |
| # host: 'linux' | |
| # target: 'android' | |
| # arch: 'android_armv7' | |
| # modules: 'qtcharts debug_info' | |
| # dir: '${{ github.workspace }}/output/android/' | |
| # cached: ${{ steps.cache-qt-android.outputs.cache-hit }} | |
| # - name: Compile Android | |
| # run: cd src; qmake; make -j4 | |
| # - name: Install Qt MacOS | |
| # uses: jurplel/install-qt-action@v2 | |
| # with: | |
| # version: '5.12.9' | |
| # host: 'mac' | |
| # target: 'desktop' | |
| # modules: 'qtcharts debug_info' | |
| # dir: '${{ github.workspace }}/output/macos/' | |
| # - name: Compile MacOS | |
| # run: cd src; qmake; make -j4 | |
| # This workflow contains a single job called "build" | |
| android-build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-22.04 | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # - name: Cache Qt Linux Desktop | |
| # id: cache-qt-linux-desktop | |
| # uses: actions/cache@v1 | |
| # with: | |
| # path: '${{ github.workspace }}/output/linux-desktop/' | |
| # key: ${{ runner.os }}-QtCache-Linux-Desktop | |
| # - name: Cache Qt Linux Android | |
| # id: cache-qt-android | |
| # uses: actions/cache@v1 | |
| # with: | |
| # path: '${{ github.workspace }}/output/android/' | |
| # key: ${{ runner.os }}-QtCache-Android | |
| - name: Xvfb install and run | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb -ac ${{ env.DISPLAY }} -screen 0 1280x780x24 & | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| submodules: 'false' # Prima disattiva il checkout automatico dei submodule | |
| - name: Checkout submodules with specific branches | |
| run: | | |
| git submodule init | |
| git submodule update --init --recursive | |
| - name: Install packages required to run QZ inside workflow | |
| run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qttools5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev | |
| # - name: Test Peloton API | |
| # if: github.event_name == 'push' || github.event_name == 'schedule' | |
| # run: cd /home/runner/work/qdomyos-zwift/qdomyos-zwift/src/; ./qdomyos-zwift -test-peloton -peloton-username ${{ secrets.peloton_username }} -peloton-password ${{ secrets.peloton_password }} | |
| # timeout-minutes: 2 | |
| # - name: Test Home Fitness Buddy API | |
| # run: cd /home/runner/work/qdomyos-zwift/qdomyos-zwift/src/; ./qdomyos-zwift -test-hfb | |
| # timeout-minutes: 2 | |
| # - uses: actions/checkout@v2 | |
| # with: | |
| # repository: nttld/setup-ndk | |
| # path: setup-ndk | |
| # The packages.json in nttld/setup-ndk has already been updated, | |
| # https://github.com/nttld/setup-ndk/commit/831db5b02a0f0cab80614619efe461a3dcc140e6 | |
| # but `dist/*` has not been rebuilt yet. Build it. | |
| # https://github.com/nttld/setup-ndk/tree/main/dist | |
| # - name: Locally rebuilt setup-ndk | |
| # run: | | |
| # npm -prefix ./setup-ndk install | |
| # npm -prefix ./setup-ndk run all | |
| # Install using locally rebuilt setup-ndk | |
| # - name: Setup Android NDK r21d | |
| # uses: ./setup-ndk | |
| #- uses: nttld/setup-ndk@v1 | |
| # with: | |
| # ndk-version: r21d | |
| # waiting github.com/jurplel/install-qt-action/issues/63 | |
| - name: Install Qt Android | |
| uses: jdpurcell/install-qt-action@v5 | |
| with: | |
| version: '5.15.0' | |
| host: 'linux' | |
| target: 'android' | |
| arch: 'android' | |
| modules: 'qtcharts qtnetworkauth qtpurchasing' | |
| dir: '${{ github.workspace }}/output/android/' | |
| cache: 'false' | |
| - name: Install custom 16K-page-size Qt (overlay onto stock Qt install) | |
| run: | | |
| QT_DIR="${{ github.workspace }}/output/android/Qt/5.15.0/android" | |
| curl -fsSL -o /tmp/qt5.15.0-android-page16.zip https://github.com/cagnulein/qt-5.15.0-android-page16k/releases/download/1.0.0/qt5.15.0-android-page16.zip | |
| unzip -q /tmp/qt5.15.0-android-page16.zip -d /tmp/qt-page16k | |
| # Overlay the 16K-page-aligned target libs/plugins/qml/mkspecs/jar/include onto the | |
| # stock Qt install; keep the stock Linux host tools (bin/) since the custom Qt's | |
| # host tools were built on macOS (Mach-O, not usable on this Linux runner). | |
| rsync -a --exclude='bin/' "/tmp/qt-page16k/qt5.15.0-android-page16/usr/local/Qt-5.15.0/" "$QT_DIR/" | |
| # qdevice.pri comes from the overlay carrying the macOS origin's NDK host value; | |
| # fix it back to linux so qmake resolves the NDK toolchain path correctly. | |
| sed -i 's/darwin-x86_64/linux-x86_64/' "$QT_DIR/mkspecs/qdevice.pri" | |
| rm -rf /tmp/qt5.15.0-android-page16.zip /tmp/qt-page16k | |
| - name: Install Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| - name: patching qt for bluetooth | |
| run: cp qt-patches/android/5.15.0/jar/*.* ${{ github.workspace }}/output/android/Qt/5.15.0/android/jar/ | |
| - name: download 3rd party files for qthttpserver | |
| run: cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Cache Android NDK | |
| id: cache-ndk | |
| uses: actions/cache@v4 | |
| with: | |
| path: /usr/local/lib/android/sdk/ndk/21.1.6352462 | |
| key: android-ndk-21.1.6352462-${{ runner.os }} | |
| - name: Install Android SDK packages | |
| run: | | |
| SDKMANAGER="/usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager" | |
| echo "y" | $SDKMANAGER "ndk;21.1.6352462" "platforms;android-35" "build-tools;35.0.0" | |
| - name: Setup ccache | |
| run: | | |
| sudo apt-get install -y ccache | |
| echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> $GITHUB_ENV | |
| ccache --set-config=max_size=2G | |
| ccache --set-config=compression=true | |
| ccache --set-config=compression_level=6 | |
| ccache --set-config=base_dir=${{ github.workspace }} | |
| ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,file_macro | |
| ccache --zero-stats | |
| - name: Restore ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .ccache | |
| key: ccache-android-ndk21_1-${{ hashFiles('src/**/*.cpp', 'src/**/*.h', 'src/*.pro') }} | |
| restore-keys: | | |
| ccache-android-ndk21_1- | |
| - name: Setup NDK environment with ccache | |
| run: | | |
| NDK_PATH=/usr/local/lib/android/sdk/ndk/21.1.6352462 | |
| NDK_BIN=$NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin | |
| ln -sfn $NDK_PATH /usr/local/lib/android/sdk/ndk-bundle | |
| rm -rf /usr/local/lib/android/sdk/ndk/25.1.8937393 | |
| echo "ANDROID_NDK=/usr/local/lib/android/sdk/ndk-bundle" >> $GITHUB_ENV | |
| echo "ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk-bundle" >> $GITHUB_ENV | |
| # Wrap NDK compilers with ccache for build caching | |
| if [ ! -f "$NDK_BIN/clang.real" ]; then | |
| mv $NDK_BIN/clang $NDK_BIN/clang.real | |
| mv $NDK_BIN/clang++ $NDK_BIN/clang++.real | |
| fi | |
| printf '#!/bin/bash\nexec /usr/bin/ccache %s/clang.real "$@"\n' "$NDK_BIN" > $NDK_BIN/clang | |
| printf '#!/bin/bash\nexec /usr/bin/ccache %s/clang++.real "$@"\n' "$NDK_BIN" > $NDK_BIN/clang++ | |
| chmod +x $NDK_BIN/clang $NDK_BIN/clang++ | |
| - name: Generate secrets | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| echo "#define LICENSE" >> secret.h | |
| - name: Prepare Android signing key | |
| env: | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| SIGNING_ALIAS: ${{ secrets.ALIAS }} | |
| KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: | | |
| if [ -z "$SIGNING_KEY" ] || [ -z "$SIGNING_ALIAS" ] || [ -z "$KEY_STORE_PASSWORD" ] || [ -z "$KEY_PASSWORD" ]; then | |
| echo "Android signing secrets are not available; APK re-signing will be skipped." | |
| echo "CI_ANDROID_RESIGN_APK=false" >> "$GITHUB_ENV" | |
| exit 0 | |
| fi | |
| KEYSTORE="${{ github.workspace }}/src/android/ci-signing-key.jks" | |
| if ! printf '%s' "$SIGNING_KEY" | base64 --decode > "$KEYSTORE"; then | |
| echo "Failed to decode Android signing key." | |
| rm -f "$KEYSTORE" | |
| exit 1 | |
| fi | |
| if [ ! -s "$KEYSTORE" ]; then | |
| echo "Decoded Android signing key is empty." | |
| rm -f "$KEYSTORE" | |
| exit 1 | |
| fi | |
| echo "CI_ANDROID_SIGNING_KEYSTORE=$KEYSTORE" >> "$GITHUB_ENV" | |
| echo "CI_ANDROID_RESIGN_APK=true" >> "$GITHUB_ENV" | |
| - name: Build qthttpserver for Android | |
| run: | | |
| cd src/qthttpserver | |
| qmake | |
| make -j8 | |
| make install | |
| - name: Build QZ for Android (4 ABIs) | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| # CONFIG+=debug matches the real reference build validated against the Mac-built | |
| # APK: it keeps .so unstripped (matching the reference almost byte-for-byte) and, | |
| # with this custom Qt, naturally leaves android-extra-libs unset - the bundled | |
| # android_openssl libs are not 16K-page-aligned, so we must NOT inject them (see | |
| # below); Qt's own QtNetwork already has openssl linked in. | |
| # Deliberately not one && chain: bash -e does not exit for a failure | |
| # in a && list except after the final &&, so a broken `make -j4` | |
| # was swallowed and only surfaced later as androiddeployqt's | |
| # "Cannot find application binary". One command per line fails here. | |
| qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.1.6352462' 'CONFIG+=debug' | |
| make -j4 | |
| make INSTALL_ROOT=${{ github.workspace }}/output/android/ install | |
| cat src/android-qdomyos-zwift-deployment-settings.json | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/.gradle-android/caches | |
| ${{ github.workspace }}/.gradle-android/wrapper | |
| key: gradle-android-${{ runner.os }}-v2 | |
| restore-keys: | | |
| gradle-android-${{ runner.os }}- | |
| - name: Build Android package | |
| run: | | |
| cd src | |
| mkdir -p ${{ github.workspace }}/output/android | |
| rsync -a --exclude build --exclude .gradle android/ ${{ github.workspace }}/output/android/ | |
| androiddeployqt --input android-qdomyos-zwift-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-35 --gradle --aux-mode | |
| export GRADLE_USER_HOME="${{ github.workspace }}/.gradle-android" | |
| export GRADLE_OPTS="-Dgradle.user.home=$GRADLE_USER_HOME" | |
| export GRADLE_DIST_DIR="${{ github.workspace }}/gradle-8.13" | |
| export QT_ANDROID_DIR="${{ github.workspace }}/output/android/Qt/5.15.0/android" | |
| mkdir -p "$GRADLE_USER_HOME" | |
| rm -f "$GRADLE_USER_HOME/gradle.properties" | |
| rm -f "$HOME/.gradle/gradle.properties" | |
| find ${{ github.workspace }}/output/android \( -name '*.properties' -o -name '*.gradle' -o -name '*.gradle.kts' \) -exec sed -i '/android\.bundle\.enableUncompressedNativeLibs/d' {} + | |
| printf '\nqt5AndroidDir=%s/src/android/java\n' "$QT_ANDROID_DIR" >> ${{ github.workspace }}/output/android/gradle.properties | |
| echo "Residual enableUncompressedNativeLibs matches after sanitization:" | |
| if grep -RInE "android\\.bundle\\.enableUncompressedNativeLibs|enableUncompressedNativeLibs" ${{ github.workspace }}/output/android "$GRADLE_USER_HOME" "$HOME/.gradle" ; then | |
| echo "Unexpected residual matches found" | |
| exit 1 | |
| fi | |
| find ${{ github.workspace }}/output/android -name gradle.properties -print -exec cat {} \; | |
| if [ ! -x "$GRADLE_DIST_DIR/bin/gradle" ]; then | |
| curl -fsSL https://services.gradle.org/distributions/gradle-8.13-bin.zip -o /tmp/gradle-8.13-bin.zip | |
| unzip -q /tmp/gradle-8.13-bin.zip -d ${{ github.workspace }} | |
| fi | |
| "$GRADLE_DIST_DIR/bin/gradle" -g "$GRADLE_USER_HOME" --no-daemon -p ${{ github.workspace }}/output/android assembleDebug bundleDebug | |
| - name: Re-sign APK for stable App Links fingerprint | |
| run: | | |
| if [ "$CI_ANDROID_RESIGN_APK" != "true" ]; then | |
| echo "Skipping APK re-signing because Android signing secrets are not available." | |
| exit 0 | |
| fi | |
| APK_PATH="${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk" | |
| SIGNED_APK_PATH="${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-signed.apk" | |
| trap 'rm -f "$CI_ANDROID_SIGNING_KEYSTORE" "$SIGNED_APK_PATH"' EXIT | |
| APKSIGNER=$(find /usr/local/lib/android/sdk/build-tools -name apksigner | sort | tail -n 1) | |
| if [ -z "$APKSIGNER" ]; then | |
| echo "apksigner not found" | |
| exit 1 | |
| fi | |
| "$APKSIGNER" sign \ | |
| --ks "$CI_ANDROID_SIGNING_KEYSTORE" \ | |
| --ks-key-alias "${{ secrets.ALIAS }}" \ | |
| --ks-pass "pass:${{ secrets.KEY_STORE_PASSWORD }}" \ | |
| --key-pass "pass:${{ secrets.KEY_PASSWORD }}" \ | |
| --out "$SIGNED_APK_PATH" \ | |
| "$APK_PATH" | |
| mv "$SIGNED_APK_PATH" "$APK_PATH" | |
| - name: Show ccache stats | |
| if: always() | |
| run: ccache --show-stats | |
| - name: Archive apk binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fdroid-android-trial | |
| path: ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk | |
| android-emulator-test: | |
| if: false # fork: disabled - only android-build and window-* build here | |
| runs-on: ubuntu-latest | |
| needs: android-build | |
| continue-on-error: ${{ matrix.flaky || false }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| api-level: [24, 26, 28, 29, 30, 31, 33, 35, 36] | |
| include: | |
| - api-level: 24 | |
| target: default | |
| arch: x86 | |
| android-version: "Android 7.0" | |
| - api-level: 26 | |
| target: default | |
| arch: x86 | |
| android-version: "Android 8.0" | |
| - api-level: 28 | |
| target: default | |
| arch: x86 | |
| android-version: "Android 9.0" | |
| - api-level: 29 | |
| target: default | |
| arch: x86 | |
| android-version: "Android 10" | |
| - api-level: 30 | |
| target: google_apis | |
| arch: x86 | |
| android-version: "Android 11" | |
| - api-level: 31 | |
| target: google_apis | |
| arch: x86_64 | |
| android-version: "Android 12" | |
| - api-level: 33 | |
| target: google_apis | |
| arch: x86_64 | |
| android-version: "Android 13" | |
| flaky: true | |
| - api-level: 35 | |
| target: google_apis | |
| arch: x86_64 | |
| android-version: "Android 15" | |
| - api-level: 36 | |
| target: google_apis | |
| arch: x86_64 | |
| android-version: "Android 16" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| # Download the APK from the previous job | |
| - name: Download APK Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: fdroid-android-trial | |
| path: apk-debug | |
| - name: Setup Java for Android Emulator | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Run tests on emulator (${{ matrix.android-version }}) | |
| uses: ReactiveCircus/android-emulator-runner@v2 | |
| with: | |
| api-level: ${{ matrix.api-level }} | |
| target: ${{ matrix.target }} | |
| arch: ${{ matrix.arch }} | |
| profile: Nexus 6 | |
| disable-animations: true | |
| script: | | |
| # Display available space | |
| df -h | |
| # List available files | |
| echo "Files in apk-debug directory:" | |
| ls -la apk-debug/ | |
| # Install the APK | |
| adb install apk-debug/android-debug.apk | |
| # Grant runtime (dangerous) permissions | |
| echo "Granting runtime permissions..." | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.ACCESS_FINE_LOCATION || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.ACCESS_COARSE_LOCATION || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.BLUETOOTH_ADVERTISE || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.BLUETOOTH_CONNECT || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.BLUETOOTH_SCAN || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.READ_EXTERNAL_STORAGE || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.WRITE_EXTERNAL_STORAGE || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.CAMERA || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.RECORD_AUDIO || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.READ_PHONE_STATE || true | |
| adb shell pm grant org.cagnulen.qdomyoszwift android.permission.POST_NOTIFICATIONS || true | |
| # Enable special app ops permissions | |
| adb shell appops set org.cagnulen.qdomyoszwift MANAGE_EXTERNAL_STORAGE allow || true | |
| adb shell appops set org.cagnulen.qdomyoszwift SYSTEM_ALERT_WINDOW allow || true | |
| adb shell appops set org.cagnulen.qdomyoszwift WRITE_SETTINGS allow || true | |
| echo "All permissions granted successfully" | |
| # Start the main activity | |
| adb shell am start -n org.cagnulen.qdomyoszwift/org.cagnulen.qdomyoszwift.CustomQtActivity | |
| # Wait for app to start | |
| sleep 90 | |
| # Verify the app is running | |
| echo "Checking if app is running..." | |
| # Use different ps commands for different Android versions | |
| adb shell "ps -A 2>/dev/null || ps" > process_list.txt | |
| # Debug: show all processes to understand the format | |
| echo "=== All running processes ===" | |
| cat process_list.txt | head -20 | |
| echo "=== Looking for our app ===" | |
| grep -q "qdomyos" process_list.txt || (echo "App process not found in process list" && echo "TEST FAILED: App process not running" && exit 1) | |
| adb shell pm list packages | grep org.cagnulen.qdomyoszwift | |
| echo "=== Checking app info ===" | |
| adb shell dumpsys package org.cagnulen.qdomyoszwift | grep -A5 -B5 "state" | |
| echo "=== Logcat output for debugging ===" | |
| adb logcat -d | grep -i "qdomyos\|crash\|error\|exception\|fatal" | tail -n 50 | |
| echo "=== Full recent logcat ===" | |
| adb logcat -d | tail -n 100 | |
| echo "App is running successfully" | |
| # Take a screenshot for verification | |
| adb shell screencap -p /sdcard/screenshot.png | |
| adb pull /sdcard/screenshot.png | |
| # Test orientamento automatico con screenshot | |
| echo "Starting orientation test with automatic screenshots..." | |
| # Screenshot iniziale (orientamento corrente) | |
| adb shell screencap -p /sdcard/screenshot_orientation_0.png | |
| adb pull /sdcard/screenshot_orientation_0.png | |
| # Loop per 3 rotazioni aggiuntive (90°, 180°, 270°) | |
| for i in 1 2 3; do echo "Rotating to orientation $i (90° * $i)"; adb shell settings put system user_rotation $i; sleep 5; echo "Taking screenshot for orientation $i"; adb shell screencap -p /sdcard/screenshot_orientation_$i.png; adb pull /sdcard/screenshot_orientation_$i.png; done | |
| echo "Orientation test completed - 4 screenshots captured" | |
| # Check if the package is installed | |
| adb shell pm list packages | grep org.cagnulen.qdomyoszwift | |
| # Save logcat for debugging | |
| echo "Saving logcat for analysis..." | |
| adb logcat -d > full_logcat.txt | |
| adb logcat -d | grep -i qdomyos > qdomyos_logcat.txt | |
| - name: Upload test evidence | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-emulator-test-evidence-api${{ matrix.api-level }} | |
| path: | | |
| screenshot.png | |
| screenshot_orientation_*.png | |
| process_list.txt | |
| full_logcat.txt | |
| qdomyos_logcat.txt | |
| if-no-files-found: warn | |
| ios-build: | |
| if: false # fork: disabled - only android-build and window-* build here | |
| # The type of runner that the job will run on | |
| runs-on: macos-14 | |
| permissions: | |
| contents: write | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Checkout submodule repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bluetiger9/SmtpClient-for-Qt | |
| path: "src/smtpclient/" | |
| ref: 863843c34e03b50d41b8ae8ab6af00e9351693ca # v2.0: the first SmtpClient with Qt 6 support | |
| - name: Checkout googletest | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: google/googletest | |
| path: "tst/googletest/" | |
| ref: "release-1.12.1" | |
| - name: Install Qt iOS | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '5.15.2' | |
| host: 'mac' | |
| target: 'ios' | |
| modules: 'qtcharts qtnetworkauth' | |
| dir: '${{ github.workspace }}/output/ios/' | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-ios' | |
| - name: fix qt | |
| run: find ${{ github.workspace }}/output/ios/ -name 'ios.conf' -exec sed -i '' 's/ios-simulator/iphonesimulator/g' {} \; | |
| - name: fix qt | |
| run: find ${{ github.workspace }}/output/ios/ -name 'devices.py' -exec sed -i '' 's/\/usr\/bin\/python/\/usr\/bin\/python3/g' {} \; | |
| - name: fix qt | |
| run: find ./ -name 'qdomyos-zwift-lib.pro' -exec sed -i '' 's/TARGET = qdomyos-zwift/TARGET = qdomyoszwift/g' {} \; | |
| - name: patching qt for bluetooth | |
| run: cp qt-patches/ios/5.15.2/binary/*.* ${{ github.workspace }}/output/ios/Qt/5.15.2/ios/lib/ | |
| - name: Setup ccache | |
| run: | | |
| brew install ccache | |
| echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> $GITHUB_ENV | |
| ccache --set-config=max_size=2G | |
| ccache --set-config=compression=true | |
| ccache --set-config=compression_level=6 | |
| ccache --set-config=base_dir=${{ github.workspace }} | |
| ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,file_macro,clang_index_store | |
| ccache --zero-stats | |
| # Create wrapper scripts for Xcode (which uses absolute compiler paths, ignoring PATH) | |
| mkdir -p /tmp/ccache-wrappers | |
| printf '#!/bin/bash\nexec /opt/homebrew/bin/ccache clang "$@"\n' > /tmp/ccache-wrappers/clang | |
| printf '#!/bin/bash\nexec /opt/homebrew/bin/ccache clang++ "$@"\n' > /tmp/ccache-wrappers/clang++ | |
| chmod +x /tmp/ccache-wrappers/clang /tmp/ccache-wrappers/clang++ | |
| - name: Restore ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .ccache | |
| key: ccache-ios-${{ hashFiles('src/**/*.cpp', 'src/**/*.h', 'src/*.pro') }} | |
| restore-keys: | | |
| ccache-ios- | |
| - name: Build | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| cd .. | |
| qmake CONFIG+=debug CONFIG+=iphonesimulator \ | |
| && make -j4 | |
| - name: Show ccache stats | |
| if: always() | |
| run: ccache --show-stats | |
| window-msvc2019-build: | |
| runs-on: windows-2022 | |
| # fork: disabled. 753ff0e5 cut this fork down to Android + Windows but missed | |
| # the msvc2019 jobs, which carry no `if:` at all and so ran two Windows | |
| # runners on every push and every PR. window-build (mingw) is the Windows | |
| # build this fork ships. | |
| if: false | |
| strategy: | |
| matrix: | |
| config: | |
| - {python: true} | |
| - {python: false} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout submodule repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bluetiger9/SmtpClient-for-Qt | |
| path: "src/smtpclient/" | |
| ref: 863843c34e03b50d41b8ae8ab6af00e9351693ca # v2.0: the first SmtpClient with Qt 6 support | |
| - name: Checkout googletest | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: google/googletest | |
| path: "tst/googletest/" | |
| ref: "release-1.12.1" | |
| - name: Checkout qHttpServer | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: qt-labs/qthttpserver | |
| path: "src/qthttpserver" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.7' | |
| cache: 'pip' | |
| cache-dependency-path: .github/workflows/main.yml | |
| - name: download python and paddleocr | |
| run: | | |
| python -VV | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install "protobuf<=3.20.2,>=3.1.0" | |
| python -m pip install paddlepaddle==2.5.1 | |
| python -m pip install paddleocr | |
| python -m pip install imutils | |
| python -m pip install "Pillow<10.0.0" | |
| python -m pip install opencv-python | |
| python -m pip install numpy | |
| python -m pip install pywin32 | |
| if: matrix.config.python | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '5.15.2' | |
| host: 'windows' | |
| modules: 'qtnetworkauth qtcharts' | |
| target: "desktop" | |
| arch: win64_msvc2019_64 | |
| dir: "${{github.workspace}}/qt/" | |
| install-deps: "true" | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-windows' | |
| # see window-build: the action's default aqtinstall 3.1.21 cannot extract | |
| # Qt's archives once py7zr reaches 1.x | |
| aqtversion: '==3.3.0' | |
| - name: Install MSVC compiler | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| # 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo | |
| toolset: 14.2 | |
| arch: x64 | |
| - name: Cache qthttpserver build | |
| id: cache-qthttpserver-msvc2019 | |
| uses: actions/cache@v4 | |
| with: | |
| path: src/qthttpserver | |
| key: qthttpserver-msvc2019-${{ runner.os }}-qt5.15.2-v1 | |
| - name: download 3rd party files for qthttpserver | |
| if: steps.cache-qthttpserver-msvc2019.outputs.cache-hit != 'true' | |
| run: | | |
| cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Build qthttpserver | |
| if: steps.cache-qthttpserver-msvc2019.outputs.cache-hit != 'true' | |
| run: | | |
| cd src\qthttpserver | |
| qmake | |
| nmake | |
| cd ../.. | |
| - name: Install qthttpserver | |
| run: | | |
| cd src\qthttpserver | |
| nmake install | |
| cd ../.. | |
| - name: Secrets | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| cd .. | |
| - name: Cache vcpkg | |
| id: cache-vcpkg-msvc2019 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.workspace }}\vcpkg\installed | |
| key: vcpkg-msvc2019-x64-windows-protobuf-abseil-v1 | |
| - name: Clone vcpkg | |
| if: steps.cache-vcpkg-msvc2019.outputs.cache-hit != 'true' | |
| run: git clone https://github.com/microsoft/vcpkg.git | |
| working-directory: ${{ runner.workspace }} | |
| - name: Bootstrap vcpkg | |
| if: steps.cache-vcpkg-msvc2019.outputs.cache-hit != 'true' | |
| run: .\vcpkg\bootstrap-vcpkg.bat | |
| working-directory: ${{ runner.workspace }} | |
| - name: Create vcpkg.json | |
| if: steps.cache-vcpkg-msvc2019.outputs.cache-hit != 'true' | |
| working-directory: ${{ runner.workspace }} | |
| run: | | |
| echo '{ | |
| "name": "qdomyos-zwift", | |
| "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | |
| "dependencies": [ | |
| "protobuf", | |
| "protobuf-c", | |
| "abseil" | |
| ], | |
| "builtin-baseline": "8c2fcacefba009d63672f9d137f192765e632c9f" | |
| }' > vcpkg.json | |
| - name: Install dependencies | |
| if: steps.cache-vcpkg-msvc2019.outputs.cache-hit != 'true' | |
| run: | | |
| .\vcpkg\vcpkg install --triplet x64-windows --x-install-root=${{ runner.workspace }}\vcpkg\installed | |
| working-directory: ${{ runner.workspace }} | |
| - name: Build | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose | |
| qmake | |
| nmake | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../windows/*.py . | |
| cp ../../windows/*.bat . | |
| cp ../../../windows_openssl/*.* . | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\bin\*.* -Destination . -Verbose | |
| mkdir adb | |
| mkdir python | |
| Copy-Item -Path C:\hostedtoolcache\windows\Python\3.7.9\x64 -Destination python -Recurse | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python | |
| - name: Build without python | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose | |
| qmake | |
| nmake | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp "C:/mingw64/bin/libwinpthread-1.dll" . | |
| cp "C:/mingw64/bin/libgcc_s_seh-1.dll" . | |
| cp "C:/mingw64/bin/libstdc++-6.dll" . | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../../windows_openssl/*.* . | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\bin\*.* -Destination . -Verbose | |
| mkdir adb | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python == false | |
| # The committed msvc2019 Qt5Bluetooth DLLs are gone - they were binaries with | |
| # no recorded build procedure. Before this job can be re-enabled it needs the | |
| # qtconnectivity source build that window-build now carries, pointed at the | |
| # MSVC toolchain. Note that an MSVC Qt selects the WinRT backend, not Win32. | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-msvc2019-binary.zip | |
| if: matrix.config.python | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-msvc2019-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msvc2019-binary | |
| path: windows-msvc2019-binary.zip | |
| if: matrix.config.python | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msvc2019-binary-no-python | |
| path: windows-msvc2019-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| window-msvc2019-aiserver-build: | |
| runs-on: windows-2022 | |
| # fork: disabled, same as window-msvc2019-build - unguarded, and the AI server | |
| # is not something this fork builds. | |
| if: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout submodule repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bluetiger9/SmtpClient-for-Qt | |
| path: "src/smtpclient/" | |
| ref: 863843c34e03b50d41b8ae8ab6af00e9351693ca # v2.0: the first SmtpClient with Qt 6 support | |
| - name: Checkout googletest | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: google/googletest | |
| path: "tst/googletest/" | |
| ref: "release-1.12.1" | |
| - name: Checkout qHttpServer | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: qt-labs/qthttpserver | |
| path: "src/qthttpserver" | |
| - name: Install CMake | |
| uses: lukka/get-cmake@latest | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '5.15.2' | |
| host: 'windows' | |
| modules: 'qtnetworkauth qtcharts' | |
| target: "desktop" | |
| arch: win64_msvc2019_64 | |
| dir: "${{github.workspace}}/qt/" | |
| install-deps: "true" | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-windows' | |
| # see window-build: the action's default aqtinstall 3.1.21 cannot extract | |
| # Qt's archives once py7zr reaches 1.x | |
| aqtversion: '==3.3.0' | |
| - name: Install MSVC compiler | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| # 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo | |
| toolset: 14.2 | |
| arch: x64 | |
| - name: Cache qthttpserver build | |
| id: cache-qthttpserver-aiserver | |
| uses: actions/cache@v4 | |
| with: | |
| path: src/qthttpserver | |
| key: qthttpserver-msvc2019-${{ runner.os }}-qt5.15.2-v1 | |
| - name: download 3rd party files for qthttpserver | |
| if: steps.cache-qthttpserver-aiserver.outputs.cache-hit != 'true' | |
| run: | | |
| cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Build qthttpserver | |
| if: steps.cache-qthttpserver-aiserver.outputs.cache-hit != 'true' | |
| run: | | |
| cd src\qthttpserver | |
| qmake | |
| nmake | |
| cd ../.. | |
| - name: Install qthttpserver | |
| run: | | |
| cd src\qthttpserver | |
| nmake install | |
| cd ../.. | |
| - name: Secrets | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| cd .. | |
| - name: Cache vcpkg | |
| id: cache-vcpkg-aiserver | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.workspace }}\vcpkg\installed | |
| key: vcpkg-msvc2019-x64-windows-protobuf-abseil-v1 | |
| - name: Clone vcpkg | |
| if: steps.cache-vcpkg-aiserver.outputs.cache-hit != 'true' | |
| run: git clone https://github.com/microsoft/vcpkg.git | |
| working-directory: ${{ runner.workspace }} | |
| - name: Bootstrap vcpkg | |
| if: steps.cache-vcpkg-aiserver.outputs.cache-hit != 'true' | |
| run: .\vcpkg\bootstrap-vcpkg.bat | |
| working-directory: ${{ runner.workspace }} | |
| - name: Create vcpkg.json | |
| if: steps.cache-vcpkg-aiserver.outputs.cache-hit != 'true' | |
| working-directory: ${{ runner.workspace }} | |
| run: | | |
| echo '{ | |
| "name": "qdomyos-zwift", | |
| "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | |
| "dependencies": [ | |
| "protobuf", | |
| "protobuf-c", | |
| "abseil" | |
| ], | |
| "builtin-baseline": "8c2fcacefba009d63672f9d137f192765e632c9f" | |
| }' > vcpkg.json | |
| - name: Install dependencies | |
| if: steps.cache-vcpkg-aiserver.outputs.cache-hit != 'true' | |
| run: | | |
| .\vcpkg\vcpkg install --triplet x64-windows --x-install-root=${{ runner.workspace }}\vcpkg\installed | |
| working-directory: ${{ runner.workspace }} | |
| - name: Build | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose | |
| cd src | |
| echo "#define AISERVER" >> aiserver.h | |
| cd .. | |
| qmake | |
| nmake | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../windows/zwift-incline-ai-server.py zwift-incline.py | |
| cp ../../windows/zwift-incline-climb-portal-ai-server.py zwift-incline-climb-portal.py | |
| cp ../../windows/zwift-workout-ai-server.py zwift-workout.py | |
| cp ../../windows/*.bat . | |
| cp ../../../windows_openssl/*.* . | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\bin\*.* -Destination . -Verbose | |
| mkdir adb | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| # The committed msvc2019 Qt5Bluetooth DLLs are gone - they were binaries with | |
| # no recorded build procedure. Before this job can be re-enabled it needs the | |
| # qtconnectivity source build that window-build now carries, pointed at the | |
| # MSVC toolchain. Note that an MSVC Qt selects the WinRT backend, not Win32. | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-msvc2019-ai-server-binary.zip | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msvc2019-ai-server-binary | |
| path: windows-msvc2019-ai-server-binary.zip | |
| raspberry-pi-build: | |
| if: false # fork: disabled - only android-build and window-* build here | |
| runs-on: ubuntu-22.04-arm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Secrets | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| echo "#define LICENSE" >> secret.h | |
| cd .. | |
| - name: Build for Raspberry Pi | |
| run: | | |
| docker run --rm --platform linux/arm/v6 \ | |
| -v ${{ github.workspace }}:/workspace -w /workspace \ | |
| balenalib/raspberry-pi-debian:bullseye-build \ | |
| bash -c " | |
| set -ex && | |
| for i in 1 2 3; do apt-get update && break || sleep 5; done && | |
| for i in 1 2 3; do apt-get install -y --fix-missing build-essential git cmake qtbase5-dev qtbase5-private-dev qtchooser qt5-qmake qtbase5-dev-tools qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev libqt5charts5-dev qtpositioning5-dev qtconnectivity5-dev libqt5websockets5-dev libqt5texttospeech5-dev libqt5bluetooth5 libqt5networkauth5-dev qml-module-qtlocation qml-module-qtpositioning qtlocation5-dev libqt5quickcontrols2-5 qtquickcontrols2-5-dev qml-module-qtquick-controls2 qtbase5-dev libqt5sql5-sqlite libqt5sql5 libqt5sql5-mysql libqt5sql5-psql && break || sleep 5; done && | |
| export QT_SELECT=qt5 && | |
| export PATH=/usr/lib/qt5/bin:\$PATH && | |
| sed -i '/QtHttpServer/d' qdomyos-zwift.pro && | |
| find src -type f \( -name '*.cpp' -o -name '*.h' \) -exec sed -i 's/#include <QtHttpServer/\/\/#include <QtHttpServer/' {} + && | |
| find src -type f \( -name '*.cpp' -o -name '*.h' \) -exec sed -i 's/QHttpServer/\/\/QHttpServer/' {} + && | |
| cat qdomyos-zwift.pro && | |
| qmake && | |
| make -j\$(nproc) | |
| " | |
| - name: Rename binary | |
| run: mv src/qdomyos-zwift src/qdomyos-zwift-armv6hf | |
| - name: Verify 32-bit binary targets ARMv6 | |
| run: | | |
| ARCH=$(readelf -A src/qdomyos-zwift-armv6hf | grep 'Tag_CPU_arch:' | awk '{print $2}') | |
| echo "Binary CPU architecture: $ARCH" | |
| if [ "$ARCH" != "v6" ]; then | |
| echo "::error::Binary targets $ARCH but must target v6 for Pi Zero W compatibility" | |
| exit 1 | |
| fi | |
| - name: Archive Raspberry Pi binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: raspberry-pi-binary-armv6hf | |
| path: src/qdomyos-zwift-armv6hf | |
| raspberry-pi-build-and-image-64bit: | |
| if: false # fork: disabled - only android-build and window-* build here | |
| runs-on: ubuntu-22.04-arm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Secrets | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| echo "#define LICENSE" >> secret.h | |
| cd .. | |
| - name: Build for Raspberry Pi 64-bit | |
| uses: docker://arm64v8/debian:bullseye-20241016 | |
| with: | |
| args: > | |
| bash -c " | |
| set -ex && | |
| for i in 1 2 3; do apt-get update && break || sleep 5; done && | |
| for i in 1 2 3; do apt-get install -y --fix-missing build-essential git cmake qtbase5-dev qtbase5-private-dev qtchooser qt5-qmake qtbase5-dev-tools qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev libqt5charts5-dev qtpositioning5-dev qtconnectivity5-dev libqt5websockets5-dev libqt5texttospeech5-dev libqt5bluetooth5 libqt5networkauth5-dev qml-module-qtlocation qml-module-qtpositioning qtlocation5-dev libqt5quickcontrols2-5 qtquickcontrols2-5-dev qml-module-qtquick-controls2 qtbase5-dev libqt5sql5-sqlite libqt5sql5 libqt5sql5-mysql libqt5sql5-psql && break || sleep 5; done && | |
| export QT_SELECT=qt5 && | |
| export PATH=/usr/lib/qt5/bin:$PATH && | |
| cd /github/workspace && | |
| sed -i '/QtHttpServer/d' qdomyos-zwift.pro && | |
| find src -type f \( -name '*.cpp' -o -name '*.h' \) -exec sed -i 's/#include <QtHttpServer/\/\/#include <QtHttpServer/' {} + && | |
| find src -type f \( -name '*.cpp' -o -name '*.h' \) -exec sed -i 's/QHttpServer/\/\/QHttpServer/' {} + && | |
| cat qdomyos-zwift.pro && | |
| qmake && | |
| make -j$(nproc) | |
| " | |
| - name: Rename binary | |
| run: mv src/qdomyos-zwift src/qdomyos-zwift-aarch64 | |
| - name: Verify 64-bit binary glibc compatibility | |
| run: | | |
| MAX_GLIBC=$(readelf -V src/qdomyos-zwift-aarch64 | grep -oP 'GLIBC_\K[0-9.]+' | sort -V | tail -1) | |
| echo "Max required GLIBC version: $MAX_GLIBC" | |
| if dpkg --compare-versions "$MAX_GLIBC" gt "2.31"; then | |
| echo "::error::Binary requires GLIBC $MAX_GLIBC but Raspberry Pi OS Bullseye only has 2.31" | |
| exit 1 | |
| fi | |
| - name: Archive Raspberry Pi 64bit binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: raspberry-pi-binary-aarch64 | |
| path: src/qdomyos-zwift-aarch64 | |
| raspberry-pi-smoke-test: | |
| if: false # fork: disabled - only android-build and window-* build here | |
| runs-on: ubuntu-22.04-arm | |
| needs: [raspberry-pi-build, raspberry-pi-build-and-image-64bit] | |
| steps: | |
| - name: Download armv6hf binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: raspberry-pi-binary-armv6hf | |
| path: bin32 | |
| - name: Download aarch64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: raspberry-pi-binary-aarch64 | |
| path: bin64 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: ELF metadata checks for armv6hf binary (Pi Zero W) | |
| timeout-minutes: 5 | |
| run: | | |
| chmod +x bin32/qdomyos-zwift-armv6hf | |
| file bin32/qdomyos-zwift-armv6hf | |
| readelf -A bin32/qdomyos-zwift-armv6hf | grep -E 'Tag_CPU|Tag_FP|Tag_ABI' | |
| # Check CPU architecture is ARMv6 | |
| ARCH=$(readelf -A bin32/qdomyos-zwift-armv6hf | grep 'Tag_CPU_arch:' | awk '{print $2}') | |
| if [ "$ARCH" != "v6" ]; then | |
| echo "::error::Binary targets $ARCH, expected v6" | |
| exit 1 | |
| fi | |
| echo "PASS: CPU architecture is ARMv6" | |
| # Check hard-float ABI | |
| VFP=$(readelf -A bin32/qdomyos-zwift-armv6hf | grep 'Tag_ABI_VFP_args:' | awk '{print $2}') | |
| if [ "$VFP" != "VFP" ]; then | |
| echo "::error::Binary does not use hard-float ABI (Tag_ABI_VFP_args: $VFP)" | |
| exit 1 | |
| fi | |
| echo "PASS: Hard-float ABI (VFP registers)" | |
| # Check dynamic linker / interpreter path | |
| INTERP=$(readelf -l bin32/qdomyos-zwift-armv6hf | grep 'interpreter:' | grep -oP '/[^\]]+') | |
| if [ "$INTERP" != "/lib/ld-linux-armhf.so.3" ]; then | |
| echo "::error::Wrong interpreter: $INTERP, expected /lib/ld-linux-armhf.so.3" | |
| exit 1 | |
| fi | |
| echo "PASS: Interpreter is /lib/ld-linux-armhf.so.3" | |
| echo "SUCCESS: All armv6hf ELF metadata checks passed" | |
| - name: Runtime smoke test armv6hf binary | |
| timeout-minutes: 10 | |
| continue-on-error: true | |
| run: | | |
| docker run --rm --platform linux/arm/v6 \ | |
| -v ${{ github.workspace }}/bin32:/app \ | |
| balenalib/raspberry-pi-debian:bullseye-run \ | |
| bash -c " | |
| for i in 1 2 3; do apt-get update && break || sleep 5; done | |
| for i in 1 2 3; do apt-get install -y --no-install-recommends \ | |
| libqt5core5a libqt5bluetooth5 libqt5charts5 libqt5widgets5 \ | |
| libqt5network5 libqt5websockets5 libqt5xml5 libqt5sql5 \ | |
| libqt5multimedia5 libqt5positioning5 libqt5qml5 libqt5quick5 \ | |
| libqt5texttospeech5 libqt5networkauth5 libqt5gui5 || true && break || sleep 5; done | |
| OUTPUT=\$(/app/qdomyos-zwift-armv6hf -no-gui -smoke-test 2>&1) || true | |
| echo \"\$OUTPUT\" | |
| if echo \"\$OUTPUT\" | grep -q 'SMOKE_OK'; then | |
| echo 'SUCCESS: armv6hf binary runs and Qt runtime loads' | |
| else | |
| echo '::error::armv6hf runtime smoke test failed - SMOKE_OK not found' | |
| exit 1 | |
| fi | |
| " | |
| - name: Runtime smoke test aarch64 binary (ARM64 Bullseye - Pi 3/4/5) | |
| timeout-minutes: 10 | |
| run: | | |
| chmod +x bin64/qdomyos-zwift-aarch64 | |
| docker run --rm -v ${{ github.workspace }}/bin64:/app \ | |
| arm64v8/debian:bullseye-20241016 \ | |
| bash -c " | |
| apt-get update && apt-get install -y --no-install-recommends \ | |
| libqt5core5a libqt5bluetooth5 libqt5charts5 libqt5widgets5 \ | |
| libqt5network5 libqt5websockets5 libqt5xml5 libqt5sql5 \ | |
| libqt5multimedia5 libqt5positioning5 libqt5qml5 libqt5quick5 \ | |
| libqt5texttospeech5 libqt5networkauth5 libqt5gui5 || true | |
| OUTPUT=\$(/app/qdomyos-zwift-aarch64 -no-gui -smoke-test 2>&1) || true | |
| echo \"\$OUTPUT\" | |
| if echo \"\$OUTPUT\" | grep -q 'SMOKE_OK'; then | |
| echo 'SUCCESS: aarch64 binary runs on ARM64 Bullseye' | |
| else | |
| echo '::error::aarch64 runtime smoke test failed - SMOKE_OK not found' | |
| exit 1 | |
| fi | |
| " | |
| window-msvc2022-build: | |
| runs-on: windows-2022 | |
| if: github.event_name == 'schedule' | |
| strategy: | |
| matrix: | |
| config: | |
| - {python: true} | |
| - {python: false} | |
| steps: | |
| - name: Checkout PR code | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: refs/pull/1508/head | |
| submodules: recursive | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.7' | |
| cache: 'pip' | |
| cache-dependency-path: .github/workflows/main.yml | |
| - name: download python and paddleocr | |
| run: | | |
| python -VV | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install "protobuf<=3.20.2,>=3.1.0" | |
| python -m pip install paddlepaddle==2.5.1 | |
| python -m pip install paddleocr | |
| python -m pip install imutils | |
| python -m pip install "Pillow<10.0.0" | |
| python -m pip install opencv-python | |
| python -m pip install numpy | |
| python -m pip install pywin32 | |
| if: matrix.config.python | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '6.8.2' | |
| host: 'windows' | |
| modules: 'qtnetworkauth qtcharts qtconnectivity qtspeech qtpositioning qtwebsockets qtlocation qtmultimedia qtwebengine qtwebview qthttpserver qtwebchannel' | |
| target: "desktop" | |
| arch: win64_msvc2022_64 | |
| dir: "${{github.workspace}}/qt/" | |
| install-deps: "true" | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-windows' | |
| - name: Install MSVC compiler | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| # 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo | |
| #toolset: 14.2 | |
| arch: x64 | |
| # - name: download 3rd party files for qthttpserver | |
| # run: | | |
| # cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| # - name: Build qthttpserver | |
| # run: | | |
| # cd src\qthttpserver | |
| # qmake | |
| # nmake | |
| # nmake install | |
| # cd ../.. | |
| - name: Secrets | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| cd .. | |
| - name: Cache vcpkg | |
| id: cache-vcpkg-msvc2022 | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.workspace }}\vcpkg\installed | |
| key: vcpkg-msvc2022-x64-windows-protobuf-abseil-v1 | |
| - name: Clone vcpkg | |
| if: steps.cache-vcpkg-msvc2022.outputs.cache-hit != 'true' | |
| run: git clone https://github.com/microsoft/vcpkg.git | |
| working-directory: ${{ runner.workspace }} | |
| - name: Bootstrap vcpkg | |
| if: steps.cache-vcpkg-msvc2022.outputs.cache-hit != 'true' | |
| run: .\vcpkg\bootstrap-vcpkg.bat | |
| working-directory: ${{ runner.workspace }} | |
| - name: Create vcpkg.json | |
| if: steps.cache-vcpkg-msvc2022.outputs.cache-hit != 'true' | |
| working-directory: ${{ runner.workspace }} | |
| run: | | |
| echo '{ | |
| "name": "qdomyos-zwift", | |
| "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | |
| "dependencies": [ | |
| "protobuf", | |
| "protobuf-c", | |
| "abseil" | |
| ], | |
| "builtin-baseline": "8c2fcacefba009d63672f9d137f192765e632c9f" | |
| }' > vcpkg.json | |
| - name: Install dependencies | |
| if: steps.cache-vcpkg-msvc2022.outputs.cache-hit != 'true' | |
| run: | | |
| .\vcpkg\vcpkg install --triplet x64-windows --x-install-root=${{ runner.workspace }}\vcpkg\installed | |
| working-directory: ${{ runner.workspace }} | |
| - name: Build | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| qmake | |
| nmake | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../windows/*.py . | |
| cp ../../windows/*.bat . | |
| cp ../../../windows_openssl/*.* . | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\bin\*.* -Destination . -Verbose | |
| mkdir adb | |
| mkdir python | |
| Copy-Item -Path C:\hostedtoolcache\windows\Python\3.7.9\x64 -Destination python -Recurse | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python | |
| - name: Build without python | |
| # Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose | |
| # Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose | |
| # Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| qmake | |
| nmake | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp "C:/mingw64/bin/libwinpthread-1.dll" . | |
| cp "C:/mingw64/bin/libgcc_s_seh-1.dll" . | |
| cp "C:/mingw64/bin/libstdc++-6.dll" . | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../../windows_openssl/*.* . | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\bin\*.* -Destination . -Verbose | |
| mkdir adb | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python == false | |
| # The committed msvc2019 Qt5Bluetooth DLLs are gone - they were binaries with | |
| # no recorded build procedure. Before this job can be re-enabled it needs the | |
| # qtconnectivity source build that window-build now carries, pointed at the | |
| # MSVC toolchain. Note that an MSVC Qt selects the WinRT backend, not Win32. | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-msvc2022-binary.zip | |
| if: matrix.config.python | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-msvc2022-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msvc2022-binary | |
| path: windows-msvc2022-binary.zip | |
| if: matrix.config.python | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msvc2022-binary-no-python | |
| path: windows-msvc2022-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| window-msvc2022-pr-build: | |
| runs-on: windows-2022 | |
| # fork: disabled. Its first step checks out `ref: qt6`, and this fork has no | |
| # qt6 branch, so every PR failed here and reported a red X that had nothing to | |
| # do with the PR. One false "CI failed" report already came out of it. | |
| if: false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - {python: true} | |
| - {python: false} | |
| steps: | |
| - name: Checkout MSVC2022 branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: qt6 | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Apply current PR patch to MSVC2022 branch | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| PR_REF="refs/remotes/origin/pr-${{ github.event.pull_request.number }}" | |
| BASE_REF="refs/remotes/origin/${{ github.base_ref }}" | |
| git fetch --no-tags origin \ | |
| "+refs/heads/${{ github.base_ref }}:${BASE_REF}" \ | |
| "+refs/pull/${{ github.event.pull_request.number }}/head:${PR_REF}" | |
| git diff --binary "${BASE_REF}...${PR_REF}" -- . ':(exclude).github/workflows/**' > pr.patch | |
| if [ ! -s pr.patch ]; then | |
| echo "No non-workflow PR patch to apply on top of qt6." | |
| exit 0 | |
| fi | |
| git apply --3way --whitespace=nowarn pr.patch | |
| git submodule sync --recursive | |
| git submodule update --init --recursive | |
| git status --short | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.7' | |
| cache: 'pip' | |
| cache-dependency-path: .github/workflows/main.yml | |
| - name: download python and paddleocr | |
| run: | | |
| python -VV | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade setuptools | |
| python -m pip install "protobuf<=3.20.2,>=3.1.0" | |
| python -m pip install paddlepaddle==2.5.1 | |
| python -m pip install paddleocr | |
| python -m pip install imutils | |
| python -m pip install "Pillow<10.0.0" | |
| python -m pip install opencv-python | |
| python -m pip install numpy | |
| python -m pip install pywin32 | |
| if: matrix.config.python | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: '6.8.2' | |
| host: 'windows' | |
| modules: 'qtnetworkauth qtcharts qtconnectivity qtspeech qtpositioning qtwebsockets qtlocation qtmultimedia qtwebengine qtwebview qthttpserver qtwebchannel' | |
| target: "desktop" | |
| arch: win64_msvc2022_64 | |
| dir: "${{github.workspace}}/qt/" | |
| install-deps: "true" | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-windows' | |
| - name: Install MSVC compiler | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| - name: Secrets | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| cd .. | |
| - name: Cache vcpkg | |
| id: cache-vcpkg-msvc2022-pr | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.workspace }}\vcpkg\installed | |
| key: vcpkg-msvc2022-x64-windows-protobuf-abseil-v1 | |
| - name: Clone vcpkg | |
| if: steps.cache-vcpkg-msvc2022-pr.outputs.cache-hit != 'true' | |
| run: git clone https://github.com/microsoft/vcpkg.git | |
| working-directory: ${{ runner.workspace }} | |
| - name: Bootstrap vcpkg | |
| if: steps.cache-vcpkg-msvc2022-pr.outputs.cache-hit != 'true' | |
| run: .\vcpkg\bootstrap-vcpkg.bat | |
| working-directory: ${{ runner.workspace }} | |
| - name: Create vcpkg.json | |
| if: steps.cache-vcpkg-msvc2022-pr.outputs.cache-hit != 'true' | |
| working-directory: ${{ runner.workspace }} | |
| run: | | |
| echo '{ | |
| "name": "qdomyos-zwift", | |
| "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | |
| "dependencies": [ | |
| "protobuf", | |
| "protobuf-c", | |
| "abseil" | |
| ], | |
| "builtin-baseline": "8c2fcacefba009d63672f9d137f192765e632c9f" | |
| }' > vcpkg.json | |
| - name: Install dependencies | |
| if: steps.cache-vcpkg-msvc2022-pr.outputs.cache-hit != 'true' | |
| run: .\vcpkg\vcpkg install --triplet x64-windows --x-install-root=${{ runner.workspace }}\vcpkg\installed | |
| working-directory: ${{ runner.workspace }} | |
| - name: Build | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose | |
| qmake | |
| nmake | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../windows/*.py . | |
| cp ../../windows/*.bat . | |
| cp ../../../windows_openssl/*.* . | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\bin\*.* -Destination . -Verbose | |
| mkdir adb | |
| mkdir python | |
| Copy-Item -Path C:\hostedtoolcache\windows\Python\3.7.9\x64 -Destination python -Recurse | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python | |
| - name: Build without python | |
| run: | | |
| lrelease src/qdomyos-zwift.pri | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose | |
| qmake | |
| nmake | |
| cd src/debug | |
| mkdir output | |
| mkdir appx | |
| cp qdomyos-zwift.* output/ | |
| cd output | |
| windeployqt --qmldir ../../ qdomyos-zwift.exe | |
| cp ../../../icons/iOS/iTunesArtwork@2x.png . | |
| cp ../../AppxManifest.xml . | |
| cp ../../../windows_openssl/*.* . | |
| Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\bin\*.* -Destination . -Verbose | |
| mkdir adb | |
| cp ../../adb/* adb/ | |
| cd .. | |
| cd appx | |
| #../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz | |
| if: matrix.config.python == false | |
| # The committed msvc2019 Qt5Bluetooth DLLs are gone - they were binaries with | |
| # no recorded build procedure. Before this job can be re-enabled it needs the | |
| # qtconnectivity source build that window-build now carries, pointed at the | |
| # MSVC toolchain. Note that an MSVC Qt selects the WinRT backend, not Win32. | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-msvc2022-pr-binary.zip | |
| if: matrix.config.python | |
| - name: Zip artifact for deployment | |
| run: Compress-Archive src/debug/output windows-msvc2022-pr-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msvc2022-pr-binary | |
| path: windows-msvc2022-pr-binary.zip | |
| if: matrix.config.python | |
| - name: Archive windows binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msvc2022-pr-binary-no-python | |
| path: windows-msvc2022-pr-binary-no-python.zip | |
| if: ${{ ! matrix.config.python }} | |
| nordictrack-build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-22.04 | |
| if: false # fork: disabled - only android-build and window-* build here | |
| strategy: | |
| matrix: | |
| variant: | |
| - name: treadmill | |
| setting_key: nordictrack_2950_ip | |
| setting_value: localhost | |
| - name: bike | |
| setting_key: tdf_10_ip | |
| setting_value: localhost | |
| - name: rower | |
| setting_key: proform_rower_ip | |
| setting_value: localhost | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| - name: Xvfb install and run | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb -ac ${{ env.DISPLAY }} -screen 0 1280x780x24 & | |
| - name: Checkout PR code | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: refs/pull/3478/head | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| submodules: 'false' # Prima disattiva il checkout automatico dei submodule | |
| - name: Checkout submodules with specific branches | |
| run: | | |
| git submodule init | |
| git submodule update --init --recursive | |
| - name: Install packages required to run QZ inside workflow | |
| run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev | |
| - name: Install Qt Android | |
| uses: jdpurcell/install-qt-action@v5 | |
| with: | |
| version: '5.15.0' | |
| host: 'linux' | |
| target: 'android' | |
| arch: 'android' | |
| modules: 'qtcharts qtnetworkauth qtpurchasing' | |
| dir: '${{ github.workspace }}/output/android/' | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-android' | |
| - name: Install Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| - name: patching qt for bluetooth | |
| run: cp qt-patches/android/5.15.0/jar/*.* ${{ github.workspace }}/output/android/Qt/5.15.0/android/jar/ | |
| - name: download 3rd party files for qthttpserver | |
| run: cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Set Android NDK 21 && build | |
| run: | | |
| # Install NDK 21 after GitHub update | |
| # https://github.com/actions/virtual-environments/issues/5595 | |
| ANDROID_ROOT="/usr/local/lib/android" | |
| ANDROID_SDK_ROOT="${ANDROID_ROOT}/sdk" | |
| SDKMANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" | |
| echo "y" | $SDKMANAGER "ndk;21.4.7075529" "platforms;android-35" "build-tools;35.0.0" | |
| export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle" | |
| export ANDROID_NDK_ROOT="${ANDROID_NDK}" | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| echo "#define LICENSE" >> secret.h | |
| # Set variant-specific IP setting | |
| sed -i 's/property string ${{ matrix.variant.setting_key }}: ""/property string ${{ matrix.variant.setting_key }}: "${{ matrix.variant.setting_value }}"/' settings.qml | |
| cd .. | |
| ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK | |
| rm -rf /usr/local/lib/android/sdk/ndk/25.1.8937393 | |
| lrelease src/qdomyos-zwift.pri | |
| # QTHTTPSERVER must use the same NDK | |
| cd src/qthttpserver | |
| qmake | |
| make -j8 | |
| make install | |
| cd ../.. | |
| # Deliberately not one && chain: bash -e does not exit for a failure | |
| # in a && list except after the final &&, so a broken `make -j4` | |
| # was swallowed and only surfaced later as androiddeployqt's | |
| # "Cannot find application binary". One command per line fails here. | |
| qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' | |
| make -j4 | |
| make INSTALL_ROOT=${{ github.workspace }}/output/android/ install | |
| cp src/android-qdomyos-zwift-deployment-settings.json src/android-qdomyos-zwift-nordictrack-${{ matrix.variant.name }}-deployment-settings.json | |
| sed -i '1s|{|{\n "android-extra-libs": "${{ github.workspace }}/android_openssl/no-asm/latest/arm/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libssl_1_1.so",|' src/android-qdomyos-zwift-nordictrack-${{ matrix.variant.name }}-deployment-settings.json | |
| sed -i 's/"android-debug"/"android-nordictrack-${{ matrix.variant.name }}"/g' src/android-qdomyos-zwift-nordictrack-${{ matrix.variant.name }}-deployment-settings.json | |
| sed -i 's/android-debug\.apk/android-debug-nordictrack-${{ matrix.variant.name }}.apk/g' src/android-qdomyos-zwift-nordictrack-${{ matrix.variant.name }}-deployment-settings.json | |
| cat src/android-qdomyos-zwift-nordictrack-${{ matrix.variant.name }}-deployment-settings.json | |
| - name: Build Android package | |
| run: | | |
| cd src | |
| mkdir -p ${{ github.workspace }}/output/android | |
| rsync -a --exclude build --exclude .gradle android/ ${{ github.workspace }}/output/android/ | |
| androiddeployqt --input android-qdomyos-zwift-nordictrack-${{ matrix.variant.name }}-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-35 --gradle --aux-mode | |
| export GRADLE_USER_HOME="${{ github.workspace }}/.gradle-android" | |
| export GRADLE_OPTS="-Dgradle.user.home=$GRADLE_USER_HOME" | |
| export GRADLE_DIST_DIR="${{ github.workspace }}/gradle-8.13" | |
| export QT_ANDROID_DIR="${{ github.workspace }}/output/android/Qt/5.15.0/android" | |
| mkdir -p "$GRADLE_USER_HOME" | |
| rm -f "$GRADLE_USER_HOME/gradle.properties" | |
| rm -f "$HOME/.gradle/gradle.properties" | |
| find ${{ github.workspace }}/output/android \( -name '*.properties' -o -name '*.gradle' -o -name '*.gradle.kts' \) -exec sed -i '/android\.bundle\.enableUncompressedNativeLibs/d' {} + | |
| printf '\nqt5AndroidDir=%s/src/android/java\n' "$QT_ANDROID_DIR" >> ${{ github.workspace }}/output/android/gradle.properties | |
| echo "Residual enableUncompressedNativeLibs matches after sanitization:" | |
| if grep -RInE "android\\.bundle\\.enableUncompressedNativeLibs|enableUncompressedNativeLibs" ${{ github.workspace }}/output/android "$GRADLE_USER_HOME" "$HOME/.gradle" ; then | |
| echo "Unexpected residual matches found" | |
| exit 1 | |
| fi | |
| find ${{ github.workspace }}/output/android -name gradle.properties -print -exec cat {} \; | |
| if [ ! -x "$GRADLE_DIST_DIR/bin/gradle" ]; then | |
| curl -fsSL https://services.gradle.org/distributions/gradle-8.13-bin.zip -o /tmp/gradle-8.13-bin.zip | |
| unzip -q /tmp/gradle-8.13-bin.zip -d ${{ github.workspace }} | |
| fi | |
| "$GRADLE_DIST_DIR/bin/gradle" -g "$GRADLE_USER_HOME" --no-daemon -p ${{ github.workspace }}/output/android assembleDebug bundleDebug | |
| mv ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-nordictrack-${{ matrix.variant.name }}.apk | |
| - name: Archive nordictrack binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nordictrack-${{ matrix.variant.name }}-android-trial | |
| path: ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-nordictrack-${{ matrix.variant.name }}.apk | |
| fitpro-build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-22.04 | |
| if: false # fork: disabled - only android-build and window-* build here | |
| strategy: | |
| matrix: | |
| variant: | |
| - name: treadmill | |
| setting_key: nordictrack_2950_ip | |
| setting_value: localhost | |
| - name: bike | |
| setting_key: tdf_10_ip | |
| setting_value: localhost | |
| - name: elliptical | |
| setting_key: proform_elliptical_ip | |
| setting_value: localhost | |
| - name: rower | |
| setting_key: proform_rower_ip | |
| setting_value: localhost | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| - name: Xvfb install and run | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb -ac ${{ env.DISPLAY }} -screen 0 1280x780x24 & | |
| - name: Checkout FitPro branch code | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: claude/fervent-newton-a25bb2 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| submodules: 'false' # Prima disattiva il checkout automatico dei submodule | |
| - name: Checkout submodules with specific branches | |
| run: | | |
| git submodule init | |
| git submodule update --init --recursive | |
| - name: Install packages required to run QZ inside workflow | |
| run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev | |
| - name: Install Qt Android | |
| uses: jdpurcell/install-qt-action@v5 | |
| with: | |
| version: '5.15.0' | |
| host: 'linux' | |
| target: 'android' | |
| arch: 'android' | |
| modules: 'qtcharts qtnetworkauth qtpurchasing' | |
| dir: '${{ github.workspace }}/output/android/' | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-android' | |
| - name: Install Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| - name: patching qt for bluetooth | |
| run: cp qt-patches/android/5.15.0/jar/*.* ${{ github.workspace }}/output/android/Qt/5.15.0/android/jar/ | |
| - name: download 3rd party files for qthttpserver | |
| run: cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Set Android NDK 21 && build | |
| run: | | |
| # Install NDK 21 after GitHub update | |
| # https://github.com/actions/virtual-environments/issues/5595 | |
| ANDROID_ROOT="/usr/local/lib/android" | |
| ANDROID_SDK_ROOT="${ANDROID_ROOT}/sdk" | |
| SDKMANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" | |
| echo "y" | $SDKMANAGER "ndk;21.4.7075529" "platforms;android-35" "build-tools;35.0.0" | |
| export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle" | |
| export ANDROID_NDK_ROOT="${ANDROID_NDK}" | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| echo "#define LICENSE" >> secret.h | |
| # Set variant-specific IP setting | |
| sed -i 's/property string ${{ matrix.variant.setting_key }}: ""/property string ${{ matrix.variant.setting_key }}: "${{ matrix.variant.setting_value }}"/' settings.qml | |
| cd .. | |
| # Keep FitPro APKs usable on older 32-bit iFIT/ProForm consoles. | |
| # qmake reads defaults.pri while generating the Android deployment JSON, | |
| # so force all ABIs there before the build starts. | |
| sed -i 's/^ANDROID_ABIS = .*/ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64/' defaults.pri | |
| ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK | |
| rm -rf /usr/local/lib/android/sdk/ndk/25.1.8937393 | |
| lrelease src/qdomyos-zwift.pri | |
| # Keep FitPro APKs usable on older 32-bit iFIT/ProForm consoles. | |
| # qmake reads defaults.pri while generating the Android deployment JSON, | |
| # so force all ABIs there before the build starts. | |
| sed -i 's/^ANDROID_ABIS = .*/ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64/' defaults.pri | |
| # QTHTTPSERVER must use the same NDK | |
| cd src/qthttpserver | |
| qmake | |
| make -j8 | |
| make install | |
| cd ../.. | |
| # Deliberately not one && chain: bash -e does not exit for a failure | |
| # in a && list except after the final &&, so a broken `make -j4` | |
| # was swallowed and only surfaced later as androiddeployqt's | |
| # "Cannot find application binary". One command per line fails here. | |
| qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' | |
| make -j4 | |
| make INSTALL_ROOT=${{ github.workspace }}/output/android/ install | |
| cp src/android-qdomyos-zwift-deployment-settings.json src/android-qdomyos-zwift-fitpro-${{ matrix.variant.name }}-deployment-settings.json | |
| sed -i '1s|{|{\n "android-extra-libs": "${{ github.workspace }}/android_openssl/no-asm/latest/arm/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libssl_1_1.so",|' src/android-qdomyos-zwift-fitpro-${{ matrix.variant.name }}-deployment-settings.json | |
| sed -i 's/"android-debug"/"android-fitpro-${{ matrix.variant.name }}"/g' src/android-qdomyos-zwift-fitpro-${{ matrix.variant.name }}-deployment-settings.json | |
| sed -i 's/android-debug\.apk/android-debug-fitpro-${{ matrix.variant.name }}.apk/g' src/android-qdomyos-zwift-fitpro-${{ matrix.variant.name }}-deployment-settings.json | |
| cat src/android-qdomyos-zwift-fitpro-${{ matrix.variant.name }}-deployment-settings.json | |
| - name: Build Android package | |
| run: | | |
| cd src | |
| mkdir -p ${{ github.workspace }}/output/android | |
| rsync -a --exclude build --exclude .gradle android/ ${{ github.workspace }}/output/android/ | |
| androiddeployqt --input android-qdomyos-zwift-fitpro-${{ matrix.variant.name }}-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-35 --gradle --aux-mode | |
| export GRADLE_USER_HOME="${{ github.workspace }}/.gradle-android" | |
| export GRADLE_OPTS="-Dgradle.user.home=$GRADLE_USER_HOME" | |
| export GRADLE_DIST_DIR="${{ github.workspace }}/gradle-8.13" | |
| export QT_ANDROID_DIR="${{ github.workspace }}/output/android/Qt/5.15.0/android" | |
| mkdir -p "$GRADLE_USER_HOME" | |
| rm -f "$GRADLE_USER_HOME/gradle.properties" | |
| rm -f "$HOME/.gradle/gradle.properties" | |
| find ${{ github.workspace }}/output/android \( -name '*.properties' -o -name '*.gradle' -o -name '*.gradle.kts' \) -exec sed -i '/android\.bundle\.enableUncompressedNativeLibs/d' {} + | |
| printf '\nqt5AndroidDir=%s/src/android/java\n' "$QT_ANDROID_DIR" >> ${{ github.workspace }}/output/android/gradle.properties | |
| echo "Residual enableUncompressedNativeLibs matches after sanitization:" | |
| if grep -RInE "android\\.bundle\\.enableUncompressedNativeLibs|enableUncompressedNativeLibs" ${{ github.workspace }}/output/android "$GRADLE_USER_HOME" "$HOME/.gradle" ; then | |
| echo "Unexpected residual matches found" | |
| exit 1 | |
| fi | |
| find ${{ github.workspace }}/output/android -name gradle.properties -print -exec cat {} \; | |
| if [ ! -x "$GRADLE_DIST_DIR/bin/gradle" ]; then | |
| curl -fsSL https://services.gradle.org/distributions/gradle-8.13-bin.zip -o /tmp/gradle-8.13-bin.zip | |
| unzip -q /tmp/gradle-8.13-bin.zip -d ${{ github.workspace }} | |
| fi | |
| "$GRADLE_DIST_DIR/bin/gradle" -g "$GRADLE_USER_HOME" --no-daemon -p ${{ github.workspace }}/output/android assembleDebug bundleDebug | |
| mv ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-fitpro-${{ matrix.variant.name }}.apk | |
| APK="${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-fitpro-${{ matrix.variant.name }}.apk" | |
| for ABI in armeabi-v7a arm64-v8a x86 x86_64; do | |
| for LIB in "libqdomyos-zwift_$ABI.so" "libQt5Core_$ABI.so"; do | |
| if ! unzip -l "$APK" "lib/$ABI/$LIB" | grep -q "$LIB"; then | |
| echo "::error::Missing lib/$ABI/$LIB in $APK - ABI packaging is broken" | |
| exit 1 | |
| fi | |
| done | |
| done | |
| - name: Archive fitpro binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fitpro-${{ matrix.variant.name }}-android-trial | |
| path: ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-fitpro-${{ matrix.variant.name }}.apk | |
| peloton-bike-plus-build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-22.04 | |
| if: github.event_name == 'schedule' | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| - name: Xvfb install and run | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb -ac ${{ env.DISPLAY }} -screen 0 1280x780x24 & | |
| - name: Checkout PR code | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: refs/pull/3632/head | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| submodules: 'false' # Prima disattiva il checkout automatico dei submodule | |
| - name: Checkout submodules with specific branches | |
| run: | | |
| git submodule init | |
| git submodule update --init --recursive | |
| - name: Install packages required to run QZ inside workflow | |
| run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev | |
| - name: Install Qt Android | |
| uses: jdpurcell/install-qt-action@v5 | |
| with: | |
| version: '5.15.0' | |
| host: 'linux' | |
| target: 'android' | |
| arch: 'android' | |
| modules: 'qtcharts qtnetworkauth qtpurchasing' | |
| dir: '${{ github.workspace }}/output/android/' | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-android' | |
| - name: Install Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| - name: patching qt for bluetooth | |
| run: cp qt-patches/android/5.15.0/jar/*.* ${{ github.workspace }}/output/android/Qt/5.15.0/android/jar/ | |
| - name: download 3rd party files for qthttpserver | |
| run: cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Set Android NDK 21 && build | |
| run: | | |
| # Install NDK 21 after GitHub update | |
| # https://github.com/actions/virtual-environments/issues/5595 | |
| ANDROID_ROOT="/usr/local/lib/android" | |
| ANDROID_SDK_ROOT="${ANDROID_ROOT}/sdk" | |
| SDKMANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" | |
| echo "y" | $SDKMANAGER "ndk;21.4.7075529" "platforms;android-35" "build-tools;35.0.0" | |
| export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle" | |
| export ANDROID_NDK_ROOT="${ANDROID_NDK}" | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| echo "#define LICENSE" >> secret.h | |
| cd .. | |
| ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK | |
| rm -rf /usr/local/lib/android/sdk/ndk/25.1.8937393 | |
| lrelease src/qdomyos-zwift.pri | |
| # QTHTTPSERVER must use the same NDK | |
| cd src/qthttpserver | |
| qmake | |
| make -j8 | |
| make install | |
| cd ../.. | |
| # Deliberately not one && chain: bash -e does not exit for a failure | |
| # in a && list except after the final &&, so a broken `make -j4` | |
| # was swallowed and only surfaced later as androiddeployqt's | |
| # "Cannot find application binary". One command per line fails here. | |
| qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' | |
| make -j4 | |
| make INSTALL_ROOT=${{ github.workspace }}/output/android/ install | |
| cp src/android-qdomyos-zwift-deployment-settings.json src/android-qdomyos-zwift-peloton-bike-plus-deployment-settings.json | |
| sed -i '1s|{|{\n "android-extra-libs": "${{ github.workspace }}/android_openssl/no-asm/latest/arm/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libssl_1_1.so",|' src/android-qdomyos-zwift-peloton-bike-plus-deployment-settings.json | |
| sed -i 's/"android-debug"/"android-peloton-bike-plus"/g' src/android-qdomyos-zwift-peloton-bike-plus-deployment-settings.json | |
| sed -i 's/android-debug\.apk/android-debug-peloton-bike-plus.apk/g' src/android-qdomyos-zwift-peloton-bike-plus-deployment-settings.json | |
| cat src/android-qdomyos-zwift-peloton-bike-plus-deployment-settings.json | |
| - name: Build Android package | |
| run: | | |
| cd src | |
| mkdir -p ${{ github.workspace }}/output/android | |
| rsync -a --exclude build --exclude .gradle android/ ${{ github.workspace }}/output/android/ | |
| androiddeployqt --input android-qdomyos-zwift-peloton-bike-plus-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-35 --gradle --aux-mode | |
| export GRADLE_USER_HOME="${{ github.workspace }}/.gradle-android" | |
| export GRADLE_OPTS="-Dgradle.user.home=$GRADLE_USER_HOME" | |
| export GRADLE_DIST_DIR="${{ github.workspace }}/gradle-8.13" | |
| export QT_ANDROID_DIR="${{ github.workspace }}/output/android/Qt/5.15.0/android" | |
| mkdir -p "$GRADLE_USER_HOME" | |
| rm -f "$GRADLE_USER_HOME/gradle.properties" | |
| rm -f "$HOME/.gradle/gradle.properties" | |
| find ${{ github.workspace }}/output/android \( -name '*.properties' -o -name '*.gradle' -o -name '*.gradle.kts' \) -exec sed -i '/android\.bundle\.enableUncompressedNativeLibs/d' {} + | |
| printf '\nqt5AndroidDir=%s/src/android/java\n' "$QT_ANDROID_DIR" >> ${{ github.workspace }}/output/android/gradle.properties | |
| echo "Residual enableUncompressedNativeLibs matches after sanitization:" | |
| if grep -RInE "android\\.bundle\\.enableUncompressedNativeLibs|enableUncompressedNativeLibs" ${{ github.workspace }}/output/android "$GRADLE_USER_HOME" "$HOME/.gradle" ; then | |
| echo "Unexpected residual matches found" | |
| exit 1 | |
| fi | |
| find ${{ github.workspace }}/output/android -name gradle.properties -print -exec cat {} \; | |
| if [ ! -x "$GRADLE_DIST_DIR/bin/gradle" ]; then | |
| curl -fsSL https://services.gradle.org/distributions/gradle-8.13-bin.zip -o /tmp/gradle-8.13-bin.zip | |
| unzip -q /tmp/gradle-8.13-bin.zip -d ${{ github.workspace }} | |
| fi | |
| "$GRADLE_DIST_DIR/bin/gradle" -g "$GRADLE_USER_HOME" --no-daemon -p ${{ github.workspace }}/output/android assembleDebug bundleDebug | |
| mv ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-peloton-bike-plus.apk | |
| - name: Archive peloton-bike-plus binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: peloton-bike-plus-android-trial | |
| path: ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-peloton-bike-plus.apk | |
| peloton-bike-build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-22.04 | |
| if: github.event_name == 'schedule' | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| - name: Xvfb install and run | |
| run: | | |
| sudo apt-get install -y xvfb | |
| Xvfb -ac ${{ env.DISPLAY }} -screen 0 1280x780x24 & | |
| - name: Checkout PR code | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: refs/pull/3639/head | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| submodules: 'false' # Prima disattiva il checkout automatico dei submodule | |
| - name: Checkout submodules with specific branches | |
| run: | | |
| git submodule init | |
| git submodule update --init --recursive | |
| - name: Install packages required to run QZ inside workflow | |
| run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev | |
| - name: Install Qt Android | |
| uses: jdpurcell/install-qt-action@v5 | |
| with: | |
| version: '5.15.0' | |
| host: 'linux' | |
| target: 'android' | |
| arch: 'android' | |
| modules: 'qtcharts qtnetworkauth qtpurchasing' | |
| dir: '${{ github.workspace }}/output/android/' | |
| cache: 'true' | |
| cache-key-prefix: 'install-qt-action-android' | |
| - name: Install Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| - name: patching qt for bluetooth | |
| run: cp qt-patches/android/5.15.0/jar/*.* ${{ github.workspace }}/output/android/Qt/5.15.0/android/jar/ | |
| - name: download 3rd party files for qthttpserver | |
| run: cp qHttpServerBin/5.15.2/headers/* src/qthttpserver/src/3rdparty/http-parser/ | |
| - name: Set Android NDK 21 && build | |
| run: | | |
| # Install NDK 21 after GitHub update | |
| # https://github.com/actions/virtual-environments/issues/5595 | |
| ANDROID_ROOT="/usr/local/lib/android" | |
| ANDROID_SDK_ROOT="${ANDROID_ROOT}/sdk" | |
| SDKMANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager" | |
| echo "y" | $SDKMANAGER "ndk;21.4.7075529" "platforms;android-35" "build-tools;35.0.0" | |
| export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle" | |
| export ANDROID_NDK_ROOT="${ANDROID_NDK}" | |
| cd src | |
| echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h | |
| echo "#define PELOTON_SECRET_KEY ${{ secrets.peloton_secret_key }}" >> secret.h | |
| echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h | |
| echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h | |
| echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_ID ${{ secrets.intervalsicu_client_id }}" >> secret.h | |
| echo "#define INTERVALSICU_CLIENT_SECRET ${{ secrets.intervalsicu_client_secret }}" >> secret.h | |
| echo "${{ secrets.cesiumkey }}" >> inner_templates/googlemaps/cesium-key.js | |
| echo "#define LICENSE" >> secret.h | |
| cd .. | |
| ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK | |
| rm -rf /usr/local/lib/android/sdk/ndk/25.1.8937393 | |
| lrelease src/qdomyos-zwift.pri | |
| # QTHTTPSERVER must use the same NDK | |
| cd src/qthttpserver | |
| qmake | |
| make -j8 | |
| make install | |
| cd ../.. | |
| # Deliberately not one && chain: bash -e does not exit for a failure | |
| # in a && list except after the final &&, so a broken `make -j4` | |
| # was swallowed and only surfaced later as androiddeployqt's | |
| # "Cannot find application binary". One command per line fails here. | |
| qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' | |
| make -j4 | |
| make INSTALL_ROOT=${{ github.workspace }}/output/android/ install | |
| cp src/android-qdomyos-zwift-deployment-settings.json src/android-qdomyos-zwift-peloton-bike-deployment-settings.json | |
| sed -i '1s|{|{\n "android-extra-libs": "${{ github.workspace }}/android_openssl/no-asm/latest/arm/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libssl_1_1.so",|' src/android-qdomyos-zwift-peloton-bike-deployment-settings.json | |
| sed -i 's/"android-debug"/"android-peloton-bike"/g' src/android-qdomyos-zwift-peloton-bike-deployment-settings.json | |
| sed -i 's/android-debug\.apk/android-debug-peloton-bike.apk/g' src/android-qdomyos-zwift-peloton-bike-deployment-settings.json | |
| cat src/android-qdomyos-zwift-peloton-bike-deployment-settings.json | |
| - name: Build Android package | |
| run: | | |
| cd src | |
| mkdir -p ${{ github.workspace }}/output/android | |
| rsync -a --exclude build --exclude .gradle android/ ${{ github.workspace }}/output/android/ | |
| androiddeployqt --input android-qdomyos-zwift-peloton-bike-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-35 --gradle --aux-mode | |
| export GRADLE_USER_HOME="${{ github.workspace }}/.gradle-android" | |
| export GRADLE_OPTS="-Dgradle.user.home=$GRADLE_USER_HOME" | |
| export GRADLE_DIST_DIR="${{ github.workspace }}/gradle-8.13" | |
| export QT_ANDROID_DIR="${{ github.workspace }}/output/android/Qt/5.15.0/android" | |
| mkdir -p "$GRADLE_USER_HOME" | |
| rm -f "$GRADLE_USER_HOME/gradle.properties" | |
| rm -f "$HOME/.gradle/gradle.properties" | |
| find ${{ github.workspace }}/output/android \( -name '*.properties' -o -name '*.gradle' -o -name '*.gradle.kts' \) -exec sed -i '/android\.bundle\.enableUncompressedNativeLibs/d' {} + | |
| printf '\nqt5AndroidDir=%s/src/android/java\n' "$QT_ANDROID_DIR" >> ${{ github.workspace }}/output/android/gradle.properties | |
| echo "Residual enableUncompressedNativeLibs matches after sanitization:" | |
| if grep -RInE "android\\.bundle\\.enableUncompressedNativeLibs|enableUncompressedNativeLibs" ${{ github.workspace }}/output/android "$GRADLE_USER_HOME" "$HOME/.gradle" ; then | |
| echo "Unexpected residual matches found" | |
| exit 1 | |
| fi | |
| find ${{ github.workspace }}/output/android -name gradle.properties -print -exec cat {} \; | |
| if [ ! -x "$GRADLE_DIST_DIR/bin/gradle" ]; then | |
| curl -fsSL https://services.gradle.org/distributions/gradle-8.13-bin.zip -o /tmp/gradle-8.13-bin.zip | |
| unzip -q /tmp/gradle-8.13-bin.zip -d ${{ github.workspace }} | |
| fi | |
| "$GRADLE_DIST_DIR/bin/gradle" -g "$GRADLE_USER_HOME" --no-daemon -p ${{ github.workspace }}/output/android assembleDebug bundleDebug | |
| mv ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-peloton-bike.apk | |
| - name: Archive peloton-bike binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: peloton-bike-android-trial | |
| path: ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-peloton-bike.apk | |
| upload_to_release: | |
| permissions: write-all | |
| runs-on: ubuntu-22.04 | |
| if: github.event_name == 'schedule' | |
| needs: [window-msvc2019-build, window-msvc2022-build, window-build, android-build, raspberry-pi-build, nordictrack-build, fitpro-build, peloton-bike-plus-build, peloton-bike-build, raspberry-pi-build-and-image-64bit, raspberry-pi-smoke-test] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Update nightly release | |
| uses: andelf/nightly-release@main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: nightly-${{ steps.date.outputs.date }} | |
| prerelease: false | |
| name: 'QZ nightly build - ${{ steps.date.outputs.date }}' | |
| body: | | |
| This is a nightly build of QZ. | |
| You can use this if you want to try new features without waiting for releases. | |
| From time to time, in development builds, old difficult-to-reproduce bugs are | |
| fixed, but it is also true that in the development process with the introduction | |
| of new complex code, the stability of the program may suffer compared to | |
| official releases, so **use it with caution**! | |
| ## Windows Builds: | |
| - **windows-msvc2019**: Recommended for Windows 10 | |
| - **windows-msvc2022**: Recommended for Windows 11 (experimental, QT6) | |
| - **windows**: MinGW build (alternative version) | |
| ## Other Platforms: | |
| - **fdroid-android-trial**: Android build | |
| ### NordicTrack / iFIT builds | |
| There are two different ways QZ can talk to a NordicTrack / iFIT machine, pick the one that matches your console: | |
| **gRPC builds** — these rely on the iFIT app: QZ talks to iFIT, which talks to the console. The iFIT app must be installed, running and signed in. They only work on the newer machines (the ones with the new iFIT 3D layout). | |
| - **nordictrack-treadmill-android-trial**: Treadmill (gRPC via iFIT, new 3D-layout consoles only) | |
| - **nordictrack-bike-android-trial**: Bike (gRPC via iFIT, new 3D-layout consoles only) | |
| - **nordictrack-rower-android-trial**: Rower (gRPC via iFIT, new 3D-layout consoles only) | |
| **FitPro builds** — these access the console directly over USB-HID, without going through iFIT. The iFIT app must be **closed**. They work with every iFIT version (both old and new consoles). | |
| - **fitpro-treadmill-android-trial**: Treadmill (direct USB-HID FitPro, iFIT must be closed, all iFIT versions) | |
| - **fitpro-bike-android-trial**: Bike (direct USB-HID FitPro, iFIT must be closed, all iFIT versions) | |
| - **fitpro-elliptical-android-trial**: Elliptical (direct USB-HID FitPro, iFIT must be closed, all iFIT versions) | |
| - **fitpro-rower-android-trial**: Rower (direct USB-HID FitPro, iFIT must be closed, all iFIT versions) | |
| ### Peloton / Raspberry Pi | |
| - **peloton-bike-plus-android-trial**: Peloton Bike Plus build with Grupetto backend | |
| - **peloton-bike-android-trial**: Peloton Bike build with Grupetto backend | |
| - **raspberry-pi-binary-armv6hf**: Raspberry Pi 32-bit (ARMv6 hard-float, Pi Zero W compatible) | |
| - **raspberry-pi-binary-aarch64**: Raspberry Pi 64-bit (AArch64, Pi 3/4/5) | |
| __Please help us improve QZ by reporting any issues you encounter!__ :wink: | |
| files: | | |
| windows-msvc2019-binary-no-python/* | |
| windows-msvc2019-binary/* | |
| windows-msvc2022-binary-no-python/* | |
| windows-msvc2022-binary/* | |
| windows-msvc2019-ai-server-binary/* | |
| windows-binary-no-python/* | |
| windows-binary/* | |
| fdroid-android-trial/android-debug.apk | |
| nordictrack-treadmill-android-trial/android-debug-nordictrack-treadmill.apk | |
| nordictrack-bike-android-trial/android-debug-nordictrack-bike.apk | |
| nordictrack-rower-android-trial/android-debug-nordictrack-rower.apk | |
| fitpro-treadmill-android-trial/android-debug-fitpro-treadmill.apk | |
| fitpro-bike-android-trial/android-debug-fitpro-bike.apk | |
| fitpro-elliptical-android-trial/android-debug-fitpro-elliptical.apk | |
| fitpro-rower-android-trial/android-debug-fitpro-rower.apk | |
| peloton-bike-plus-android-trial/android-debug-peloton-bike-plus.apk | |
| peloton-bike-android-trial/android-debug-peloton-bike.apk | |
| raspberry-pi-binary-armv6hf/qdomyos-zwift-armv6hf | |
| raspberry-pi-binary-aarch64/qdomyos-zwift-aarch64 | |
| # Publishes a versioned release when a `v*` tag is pushed. | |
| # | |
| # Deliberately separate from upstream's upload_to_release above: that one needs | |
| # eleven jobs, most of them dormant on this fork, so it could never complete here. | |
| # This one depends only on the two builds this fork actually ships. | |
| release: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-22.04 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: [window-qt6-build, android-build] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # A release whose assets are named after a version the binaries do not report | |
| # is worse than no release, so disagreement fails here rather than shipping. | |
| - name: Check the tag against QZ_FORK_VERSION | |
| run: | | |
| tag="${GITHUB_REF_NAME#v}" | |
| src=$(sed -n 's/^#define QZ_FORK_VERSION "\(.*\)"$/\1/p' src/qzforkversion.h) | |
| echo "tag=$tag qzforkversion.h=$src" | |
| if [ "$tag" != "$src" ]; then | |
| echo "::error::tag $GITHUB_REF_NAME disagrees with QZ_FORK_VERSION '$src' - bump src/qzforkversion.h in the commit you tag" | |
| exit 1 | |
| fi | |
| - name: Download the Windows Qt 6 build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-qt6-binary | |
| path: dist | |
| - name: Download the Android APK | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: fdroid-android-trial | |
| path: dist | |
| - name: Name the assets after the release | |
| run: | | |
| cd dist | |
| ls -l | |
| # Without the leading v, so the names match the ones the release notes quote. | |
| ver="${GITHUB_REF_NAME#v}" | |
| mv windows-qt6-binary.zip "qz-${ver}-windows-qt6.zip" | |
| mv android-debug.apk "qz-${ver}-android.apk" | |
| ls -l | |
| - name: Write the release notes | |
| run: | | |
| # Quoted heredoc on purpose: the body contains backticks, which an unquoted | |
| # one would run as commands. Placeholders are substituted below instead. | |
| cat > release-notes.md <<'NOTES' | |
| A build of a fork of [qdomyos-zwift](https://github.com/cagnulein/qdomyos-zwift), | |
| which is the work of [Roberto Viola (cagnulein)](https://github.com/cagnulein) and | |
| its contributors. Support him: [Patreon](https://www.patreon.com/cagnulein) - | |
| [Buy Me a Coffee](https://www.buymeacoffee.com/cagnulein). This fork asks for nothing. | |
| What it changes relative to upstream - including the device support it drops - | |
| is listed in [FORK.md](FORKMDURL). | |
| ## Downloads | |
| | Asset | For | | |
| | --- | --- | | |
| | `qz-VERSION-windows-qt6.zip` | Windows 10/11. Qt 6 with the WinRT Bluetooth backend. Unzip anywhere and run `qdomyos-zwift.exe`. | | |
| | `qz-VERSION-android.apk` | Android. Debug-signed, so allow installation from unknown sources. | | |
| The Windows zip is self-contained - it carries its own Qt DLLs and needs no | |
| separate Qt install. | |
| ## Verifying what you are running | |
| QZ writes its identity to the top of every log: | |
| ``` | |
| QZ fork release VERSION | |
| QZ build <sha> Qt <version> on <os> | |
| ``` | |
| NOTES | |
| sed -i "s/VERSION/${GITHUB_REF_NAME#v}/g" release-notes.md | |
| sed -i "s#FORKMDURL#${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/blob/main/FORK.md#" release-notes.md | |
| cat release-notes.md | |
| - name: Publish the release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --title "QZ $GITHUB_REF_NAME" \ | |
| --notes-file release-notes.md \ | |
| dist/qz-*-windows-qt6.zip \ | |
| dist/qz-*-android.apk |