fix: replace Q_ASSERT with proper error handling #1073
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: build | |
| on: | |
| pull_request: | |
| branches: ['master', 'release/**'] | |
| push: | |
| branches: ['master', 'release/**'] | |
| jobs: | |
| path-filter: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_build: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - '**.h' | |
| - '**.hpp' | |
| - '**.c' | |
| - '**.cpp' | |
| - '**.cc' | |
| - 'po/**' | |
| - '**.cmake' | |
| - '**/CMakeLists.txt' | |
| build-u24-x64: | |
| needs: path-filter | |
| if: ${{ needs.path-filter.outputs.should_build == 'true' }} | |
| name: build on ubuntu-24.04 with Qt6 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: >- | |
| cmake ninja-build debhelper-compat erofs-utils erofsfuse intltool libcap-dev | |
| libcli11-dev libcurl4-openssl-dev libdeflate-dev libelf-dev libexpected-dev | |
| libfuse3-dev libglib2.0-dev libgmock-dev libgtest-dev liblz4-dev liblzma-dev | |
| libostree-dev libpcre2-dev libselinux1-dev libssl-dev libsystemd-dev libyaml-cpp-dev | |
| libzstd-dev nlohmann-json3-dev pkg-config zlib1g-dev libwayland-dev wayland-protocols libgl1-mesa-dev | |
| qt6-base-dev qt6-base-private-dev | |
| version: 1.0 | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCPM_LOCAL_PACKAGES_ONLY=ON -DLINGLONG_ENABLE_WAYLAND_SEC_CTX_SUPPORT=ON | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Run tests | |
| run: cmake --build build --target test | |
| build-u24-arm: | |
| needs: path-filter | |
| if: ${{ needs.path-filter.outputs.should_build == 'true' }} | |
| name: build on ubuntu-24.04-arm with Qt6 | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: >- | |
| cmake ninja-build debhelper-compat erofs-utils erofsfuse intltool libcap-dev | |
| libcli11-dev libcurl4-openssl-dev libdeflate-dev libelf-dev libexpected-dev | |
| libfuse3-dev libglib2.0-dev libgmock-dev libgtest-dev liblz4-dev liblzma-dev | |
| libostree-dev libpcre2-dev libselinux1-dev libssl-dev libsystemd-dev libyaml-cpp-dev | |
| libzstd-dev nlohmann-json3-dev pkg-config zlib1g-dev libwayland-dev wayland-protocols libgl1-mesa-dev | |
| qt6-base-dev qt6-base-private-dev | |
| version: 1.0 | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCPM_LOCAL_PACKAGES_ONLY=ON -DLINGLONG_ENABLE_WAYLAND_SEC_CTX_SUPPORT=ON | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Run tests | |
| run: cmake --build build --target test | |
| build-u22-x64: | |
| needs: path-filter | |
| if: ${{ needs.path-filter.outputs.should_build == 'true' }} | |
| name: build on ubuntu-22.04 with Qt5 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: >- | |
| cmake ninja-build debhelper-compat erofs-utils erofsfuse intltool libcap-dev | |
| libcli11-dev libcurl4-openssl-dev libdeflate-dev libelf-dev libexpected-dev | |
| libfuse3-dev libglib2.0-dev libgmock-dev libgtest-dev liblz4-dev liblzma-dev | |
| libostree-dev libpcre2-dev libselinux1-dev libssl-dev libsystemd-dev libyaml-cpp-dev | |
| libzstd-dev nlohmann-json3-dev pkg-config zlib1g-dev libgl1-mesa-dev | |
| qtbase5-dev qtbase5-private-dev | |
| version: 1.0 | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCPM_LOCAL_PACKAGES_ONLY=ON -DENABLE_TESTING=OFF | |
| - name: Build | |
| run: cmake --build build --parallel | |
| build-u22-arm: | |
| needs: path-filter | |
| if: ${{ needs.path-filter.outputs.should_build == 'true' }} | |
| name: build on ubuntu-22.04-arm with Qt5 | |
| runs-on: ubuntu-22.04-arm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: >- | |
| cmake ninja-build debhelper-compat erofs-utils erofsfuse intltool libcap-dev | |
| libcli11-dev libcurl4-openssl-dev libdeflate-dev libelf-dev libexpected-dev | |
| libfuse3-dev libglib2.0-dev libgmock-dev libgtest-dev liblz4-dev liblzma-dev | |
| libostree-dev libpcre2-dev libselinux1-dev libssl-dev libsystemd-dev libyaml-cpp-dev | |
| libzstd-dev nlohmann-json3-dev pkg-config zlib1g-dev libgl1-mesa-dev | |
| qtbase5-dev qtbase5-private-dev | |
| version: 1.0 | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCPM_LOCAL_PACKAGES_ONLY=ON -DENABLE_TESTING=OFF | |
| - name: Build | |
| run: cmake --build build --parallel | |
| build-status: | |
| name: Final build Status | |
| needs: | |
| [path-filter, build-u24-x64, build-u24-arm, build-u22-x64, build-u22-arm] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Decide status | |
| run: | | |
| U24_X64="${{ needs.build-u24-x64.result }}" | |
| U24_ARM="${{ needs.build-u24-arm.result }}" | |
| U22_X64="${{ needs.build-u22-x64.result }}" | |
| U22_ARM="${{ needs.build-u22-arm.result }}" | |
| if [[ "$U24_X64" == "failure" || "$U24_ARM" == "failure" || "$U22_X64" == "failure" || "$U22_ARM" == "failure" ]]; then | |
| echo "One or more builds failed." | |
| exit 1 | |
| fi | |
| echo "All builds successful or skipped." | |
| exit 0 |