coverage.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: "Coverage"
  2. on:
  3. push:
  4. branches: [ "github" ]
  5. jobs:
  6. analyze:
  7. name: Analyze
  8. runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
  9. timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
  10. permissions:
  11. security-events: write
  12. strategy:
  13. fail-fast: false
  14. matrix:
  15. language: [ 'c-cpp' ]
  16. steps:
  17. - name: Checkout repository
  18. uses: actions/checkout@v4
  19. - name: Install dependencies
  20. run: |
  21. sudo apt-get update
  22. sudo add-apt-repository --yes ppa:mhier/libboost-latest
  23. sudo apt-get install --yes build-essential git meson ninja-build cmake libboost1.81-dev libboost-log1.81-dev libyaml-cpp-dev libpcap-dev libtins-dev googletest gcovr
  24. git clone https://github.com/LaKabane/libtuntap.git /tmp/libtuntap/
  25. cd /tmp/
  26. cmake -DCMAKE_BUILD_TYPE=Release -B build -S "libtuntap"
  27. cmake --build build
  28. sudo cmake --install build --prefix /usr
  29. - name: Configure
  30. run: meson setup -Db_coverage=true build
  31. - name: Build
  32. run: make
  33. - name: Run tests
  34. run: make test
  35. - name: Generate coverage reports
  36. run: ninja -C build coverage-xml
  37. - name: Upload coverage reports to Codecov
  38. uses: codecov/codecov-action@v4.0.1
  39. with:
  40. token: ${{ secrets.CODECOV_TOKEN }}
  41. slug: marek22k/crazytrace-mirror
  42. files: build/meson-logs/coverage.xml
  43. - name: Upload coverage reports to CodeScene
  44. run: |
  45. curl https://deepsource.io/cli | sh
  46. ./bin/deepsource report --analyzer test-coverage --key cxx --value-file build/meson-logs/coverage.xml
  47. env:
  48. DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}