udpated ci for coveralls #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc lcov libncurses5-dev | |
| - name: Build project | |
| run: | | |
| make | |
| - name: Run tests | |
| run: | | |
| ./test-library.out | |
| - name: Generate coverage report | |
| run: | | |
| gcov lib.c | |
| - name: Capture coverage info | |
| run: | | |
| lcov --directory . --capture --output-file coverage.info --ignore-errors unused,unsupported | |
| - name: Filter out system and test code | |
| run: | | |
| lcov --remove coverage.info 'tests/*' '/usr/*' 'test-library*' --output-file coverage.info --ignore-errors unused,unsupported | |
| - name: List coverage info | |
| run: | | |
| lcov --list coverage.info --ignore-errors unused,unsupported | |
| - name: Upload coverage to Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ./coverage.info | |