coverage.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: coverage
  2. on: [push, pull_request]
  3. jobs:
  4. coveralls:
  5. timeout-minutes: 30
  6. runs-on: ubuntu-latest
  7. steps:
  8. - uses: actions/checkout@v1
  9. - name: Reattach HEAD
  10. run: git checkout "$(echo ${{ github.ref }} | sed -E 's|refs/[a-zA-Z]+/||')"
  11. - name: Compile tests
  12. working-directory: build
  13. env:
  14. CXXFLAGS: "-O0 --coverage -fno-inline -fno-inline-small-functions -fno-default-inline"
  15. CXX: g++
  16. run: |
  17. cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON ..
  18. make -j4
  19. - name: Run tests
  20. working-directory: build
  21. env:
  22. CTEST_OUTPUT_ON_FAILURE: 1
  23. run: ctest --timeout 5 -C Debug -j4
  24. - name: Setup Python
  25. uses: actions/setup-python@master
  26. with:
  27. version: 3.7
  28. - name: Update coveralls
  29. env:
  30. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  31. COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
  32. run: |
  33. pip install --upgrade wheel
  34. pip install cpp-coveralls
  35. coveralls --gcov gcov-7 --gcov-options '\-lp' -r . -b build -x cpp -x hpp -e deps -i src
  36. codecov:
  37. timeout-minutes: 30
  38. runs-on: ubuntu-latest
  39. steps:
  40. - uses: actions/checkout@v1
  41. - name: Compile tests
  42. working-directory: build
  43. env:
  44. CXXFLAGS: "-O0 --coverage -fno-inline -fno-inline-small-functions -fno-default-inline"
  45. CXX: g++
  46. run: |
  47. cmake -DBUILD_TESTING=ON ..
  48. make -j4
  49. - name: Run tests
  50. working-directory: build
  51. env:
  52. CTEST_OUTPUT_ON_FAILURE: 1
  53. run: ctest --timeout 5 -C Debug -j4
  54. - name: Upload coverage to Codecov
  55. working-directory: build
  56. env:
  57. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  58. run: |
  59. wget https://codecov.io/bash -O codecov
  60. chmod +x codecov
  61. ./codecov -t $CODECOV_TOKEN -B $GITHUB_REF -s test/