Not running coverage on buildjet #4
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: Test | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - install-codecov | |
| jobs: | |
| run-tests: | |
| name: Run Tests | |
| timeout-minutes: 10 | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: buildjet-8vcpu-ubuntu-2204-arm | |
| container: | |
| image: ghcr.io/viam-modules/viam-camera-realsense:arm64 | |
| options: --platform linux/arm64 | |
| coverage: false | |
| - os: ubuntu-latest | |
| container: | |
| image: ghcr.io/viam-modules/viam-camera-realsense:amd64 | |
| options: --platform linux/amd64 | |
| coverage: true | |
| - os: macos-latest | |
| coverage: false | |
| container: ${{ matrix.container }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| make setup | |
| test -f ./venv/bin/activate && . ./venv/bin/activate && conan profile show | |
| - name: Lint | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| make lint | |
| if ! git diff --quiet; then | |
| echo -e "\033[31mError: lint make target produced changes. Please run 'make lint' locally and commit the results.\033[0m" | |
| git diff | |
| exit 1 | |
| fi | |
| - name: Install Conan dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| make conan-install-test | |
| - name: Build with coverage (Linux amd64 only) | |
| if: matrix.coverage == true | |
| run: | | |
| mkdir -p build-native && cd build-native | |
| cmake .. -DVIAM_REALSENSE_ENABLE_TESTS=ON -DVIAM_REALSENSE_ENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release | |
| make -j$(nproc) | |
| - name: Build without coverage (other platforms) | |
| if: matrix.coverage != true | |
| run: make build-native | |
| - name: Run the tests | |
| run: cd build-native && ctest --output-on-failure | |
| - name: Generate coverage report | |
| if: matrix.coverage == true | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y lcov | |
| cd build-native | |
| lcov --capture --directory . --output-file coverage.info | |
| lcov --remove coverage.info '/usr/*' '*/test/*' '*/build-native/_deps/*' --output-file coverage.info | |
| lcov --list coverage.info | |
| - name: Upload coverage reports to Codecov | |
| if: matrix.coverage == true | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./build-native/coverage.info | |
| flags: unittests | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false |