coverage.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Measure code coverage using Codecov
  2. name: coverage
  3. on:
  4. push:
  5. branches: master
  6. pull_request:
  7. branches: master
  8. jobs:
  9. run:
  10. name: Measure code coverage
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Install lcov
  14. run: sudo apt install -y lcov
  15. - name: Get source
  16. uses: actions/checkout@v3
  17. - name: Configure CMake
  18. run: >
  19. CC=gcc cmake -B ${{github.workspace}}/build
  20. -DCMAKE_BUILD_TYPE=Coverage
  21. - name: Build
  22. run: cmake --build ${{github.workspace}}/build
  23. - name: Run tests
  24. working-directory: ${{github.workspace}}/build
  25. run: |
  26. lcov -c -i -d src -d cmd -o coverage_base.info
  27. test/testbee2
  28. cd cmd && cp ../../cmd/test/* . && ./test.sh
  29. - name: Upload coverage reports to Codecov
  30. working-directory: ${{github.workspace}}/build
  31. run: |
  32. lcov -c -d src -d cmd -o coverage_test.info
  33. lcov -a coverage_base.info -a coverage_test.info -o coverage.info
  34. bash <(curl -s https://codecov.io/bash) -f coverage.info