2023-09-03 10:48:49 +02:00
|
|
|
name: Code Coverage
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
GGML_NLOOP: 3
|
|
|
|
GGML_N_THREADS: 1
|
|
|
|
|
2024-03-22 18:15:06 +01:00
|
|
|
concurrency:
|
2024-04-04 18:30:53 +02:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
|
2024-03-22 18:15:06 +01:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-09-03 10:48:49 +02:00
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-04-03 20:01:13 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-09-03 10:48:49 +02:00
|
|
|
|
|
|
|
- name: Dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install build-essential gcc-8 lcov
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: CC=gcc-8 make -j LLAMA_CODE_COVERAGE=1 tests
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: CC=gcc-8 make test
|
|
|
|
|
|
|
|
- name: Generate coverage report
|
|
|
|
run: |
|
|
|
|
make coverage
|
|
|
|
make lcov-report
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
with:
|
|
|
|
files: lcov-report/coverage.info
|