code-coverage.yml 775 B

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