Testing offscreen mode #19
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
| name: Qt Build and Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build-desktop: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] #windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '6.9.3' | |
| modules: 'qtcharts qtconnectivity' | |
| cache: true | |
| setup-python: true | |
| aqtversion: '==3.1.*' | |
| - name: Debug Qt Installation | |
| run: | | |
| echo "Checking Qt installation..." | |
| find $Qt6_DIR -name "Qt6Charts*" 2>/dev/null || echo "Qt6Charts not found" | |
| find $Qt6_DIR -name "Qt6Bluetooth*" 2>/dev/null || echo "Qt6Bluetooth not found" | |
| shell: bash | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libbluetooth-dev libgl1-mesa-dev | |
| sudo apt-get install -y \ | |
| libxcb-cursor0 \ | |
| libxcb-cursor-dev \ | |
| libxcb-icccm4 \ | |
| libxcb-image0 \ | |
| libxcb-keysyms1 \ | |
| libxcb-randr0 \ | |
| libxcb-render-util0 \ | |
| libxcb-xinerama0 \ | |
| libxcb-xfixes0 \ | |
| xvfb \ | |
| libgl1-mesa-dev | |
| - name: Verify Qt Installation | |
| run: | | |
| echo "Qt Directory: ${{ env.Qt6_DIR }}" | |
| echo "CMAKE_PREFIX_PATH: $CMAKE_PREFIX_PATH" | |
| qmake --version || echo "qmake not found" | |
| - name: Configure CMake | |
| working-directory: qt_app | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| working-directory: qt_app/build | |
| run: cmake --build . --config Release | |
| - name: Test | |
| working-directory: qt_app/build | |
| run: xvfb-run -a --server-args="-screen 0 1024x768x24" ctest --output-on-failure | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ProjectTimeTracker-${{ matrix.os }} | |
| path: | | |
| qt_app/build/ProjectTimeTracker* | |
| !qt_app/build/**/*.o | |
| !qt_app/build/**/*.obj | |
| # build-wasm: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # - name: Install Qt for WebAssembly | |
| # uses: jurplel/install-qt-action@v4 | |
| # with: | |
| # version: '6.5.3' | |
| # arch: 'wasm_singlethread' | |
| # modules: 'qtcharts' | |
| # cache: true | |
| # setup-python: true | |
| # aqtversion: '==3.1.*' | |
| # - name: Setup Emscripten | |
| # uses: mymindstorm/setup-emsdk@v14 | |
| # with: | |
| # version: '3.1.25' | |
| # actions-cache-folder: 'emsdk-cache' | |
| # - name: Verify Emscripten Installation | |
| # run: | | |
| # emcc --version | |
| # echo "EMSDK: $EMSDK" | |
| # - name: Configure CMake for WebAssembly | |
| # working-directory: qt_app | |
| # run: | | |
| # mkdir build-wasm | |
| # cd build-wasm | |
| # emcmake cmake .. -DCMAKE_BUILD_TYPE=Release | |
| # - name: Build WebAssembly | |
| # working-directory: qt_app/build-wasm | |
| # run: cmake --build . | |
| # - name: Upload WebAssembly artifacts | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: ProjectTimeTracker-wasm | |
| # path: | | |
| # qt_app/build-wasm/*.html | |
| # qt_app/build-wasm/*.js | |
| # qt_app/build-wasm/*.wasm | |
| # deploy-wasm: | |
| # needs: build-wasm | |
| # if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| # runs-on: ubuntu-latest | |
| # permissions: | |
| # contents: write | |
| # pages: write | |
| # id-token: write | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # - name: Download WebAssembly artifacts | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: ProjectTimeTracker-wasm | |
| # path: wasm-dist | |
| # - name: Setup Pages | |
| # uses: actions/configure-pages@v5 | |
| # - name: Upload Pages artifact | |
| # uses: actions/upload-pages-artifact@v3 | |
| # with: | |
| # path: wasm-dist | |
| # - name: Deploy to GitHub Pages | |
| # id: deployment | |
| # uses: actions/deploy-pages@v4 |