Update README.md #18
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: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| qt-version: ['6.8.2'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: ${{ matrix.qt-version }} | |
| cache: true | |
| cache-key-prefix: install-qt-action-${{ matrix.os }}-${{ matrix.qt-version }} | |
| - name: Configure CMake | |
| run: | | |
| cd tests | |
| cmake -B build -DCMAKE_BUILD_TYPE=Release | |
| - name: Build tests | |
| run: | | |
| cd tests | |
| cmake --build build --config Release | |
| - name: Run tests | |
| run: | | |
| cd tests | |
| ctest --test-dir build --output-on-failure --timeout 300 -C Release | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: test-results-${{ matrix.os }} | |
| path: tests/build/Testing/ | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| if: github.event_name == 'push' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '6.8.2' | |
| cache: true | |
| cache-key-prefix: install-qt-action-ubuntu-6.8.2 | |
| - name: Install coverage tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc lcov | |
| - name: Configure CMake with coverage | |
| run: | | |
| cd tests | |
| cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage" | |
| - name: Build and test with coverage | |
| run: | | |
| cd tests | |
| cmake --build build | |
| ctest --test-dir build --output-on-failure | |
| - name: Generate coverage report | |
| run: | | |
| cd tests | |
| lcov --capture --directory build --output-file coverage.info | |
| lcov --remove coverage.info '/usr/*' --output-file coverage.info | |
| lcov --list coverage.info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: tests/coverage.info | |
| fail_ci_if_error: false |