code-coverage.yml 902 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Code Coverage
  2. on: [push, pull_request]
  3. env:
  4. GGML_NLOOP: 3
  5. GGML_N_THREADS: 1
  6. concurrency:
  7. group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
  8. cancel-in-progress: true
  9. jobs:
  10. run:
  11. runs-on: ubuntu-20.04
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@v4
  15. - name: Dependencies
  16. run: |
  17. sudo apt-get update
  18. sudo apt-get install build-essential gcc-8 lcov
  19. - name: Build
  20. run: CC=gcc-8 make -j LLAMA_CODE_COVERAGE=1 tests
  21. - name: Run tests
  22. run: CC=gcc-8 make test
  23. - name: Generate coverage report
  24. run: |
  25. make coverage
  26. make lcov-report
  27. - name: Upload coverage to Codecov
  28. uses: codecov/codecov-action@v3
  29. env:
  30. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  31. with:
  32. files: lcov-report/coverage.info