fix(test): Use unsigned literal in count() comparisons to silence -Wt… #17
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] | |
| tags-ignore: ['**'] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - 'NOTICE' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - 'NOTICE' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: corepack enable | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: yarn | |
| - run: yarn install --immutable | |
| - run: yarn lint | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mymindstorm/setup-emsdk@v14 | |
| - run: corepack enable | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: yarn | |
| - name: Cache CMake dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: build/_deps | |
| key: ${{ runner.os }}-cmake-deps-${{ hashFiles('CMakeLists.txt', 'tests/CMakeLists.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cmake-deps- | |
| - name: Cache ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ccache | |
| key: ${{ runner.os }}-ccache-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-ccache- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cmake \ | |
| build-essential \ | |
| libeigen3-dev \ | |
| lcov \ | |
| ccache | |
| - name: Setup ccache | |
| run: | | |
| ccache --set-config=max_size=500M | |
| ccache --zero-stats | |
| - name: Configure CMake with coverage | |
| env: | |
| CC: ccache gcc | |
| CXX: ccache g++ | |
| run: | | |
| cmake -B build \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DBUILD_TESTING=ON \ | |
| -DENABLE_COVERAGE=ON | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Show ccache statistics | |
| run: ccache --show-stats | |
| - name: Run C++ tests | |
| run: ctest --test-dir build --output-on-failure --parallel | |
| - name: Generate coverage report | |
| run: | | |
| mkdir -p build/coverage | |
| lcov --directory build --capture --output-file build/coverage/coverage.info --ignore-errors source,gcov | |
| lcov --extract build/coverage/coverage.info "${PWD}/src/*" --output-file build/coverage/coverage_filtered.info --ignore-errors unused | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./build/coverage/coverage_filtered.info | |
| flags: unittests | |
| name: codecov-libsonare | |
| fail_ci_if_error: false | |
| - run: yarn install --immutable | |
| - run: yarn build | |
| - run: yarn test |