This file contains 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 with Code Coverage for C | |
# on: | |
# push: | |
# branches: | |
# - main | |
# pull_request: | |
# branches: | |
# - main | |
# jobs: | |
# build: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v2 | |
# - name: Install dependencies | |
# run: sudo apt-get update && sudo apt-get install -y lcov gcc | |
# - name: Build and run tests with coverage | |
# run: | | |
# mkdir build | |
# cd build | |
# gcc --coverage ../src/*.c ../tests/*.c -o my_test_suite | |
# ./my_test_suite | |
# - name: Capture code coverage info | |
# run: | | |
# lcov --capture --directory . --output-file coverage.info | |
# lcov --remove coverage.info '/usr/*' --output-file coverage.info # Remove system files | |
# lcov --list coverage.info | |
# - name: Upload coverage report | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# file: coverage.info | |
# flags: unittests | |
# name: codecov-ubuntu |