Skip to content

demo: cleanup headers #20

demo: cleanup headers

demo: cleanup headers #20

name: Build Corey on Ubuntu
on:
push:
branches: [ "main" ]
paths-ignore:
- 'code-coverage-results.md'
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Debug
COV_COMMIT_AUTHOR: CoverageBot
COV_COMMIT_MESSAGE: Update Coverage Report
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.COVBOT_SECRET }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y libboost-dev lcov
sudo pip3 install lcov_cobertura
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCOREY_ENABLE_COVERAGE=TRUE
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Generate coverage report
run: |
lcov --capture --directory ${{github.workspace}}/build --output-file coverage.info
lcov --remove coverage.info '/usr/*' '${{github.workspace}}/build/_deps/*' '${{github.workspace}}/build/lib/reactor/io/liburing-install/*' --output-file coverage.info
- name: Generate Cobertura report
run: |
lcov_cobertura coverage.info --base-dir ${{github.workspace}} --output coverage.xml --demangle
readlink -f coverage.xml
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage.xml
badge: true
format: markdown
output: file
- name: Commit Coverage
if: github.event_name == 'push'
run: |
git config --global user.name "${{ env.COV_COMMIT_AUTHOR }}"
git config --global user.email "masscry@users.noreply.github.com"
git add code-coverage-results.md
git commit -m "${{ env.COV_COMMIT_MESSAGE }}"
git push